Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

support yaml for the json schema markup for the ConfigMap page #131

Closed
jstrachan opened this issue Sep 12, 2016 · 3 comments
Closed

support yaml for the json schema markup for the ConfigMap page #131

jstrachan opened this issue Sep 12, 2016 · 3 comments
Assignees

Comments

@jstrachan
Copy link
Contributor

its a PITA trying to write json schema in json inside an annotation inside a yaml manifest. But YAML should be kinda easy - as its simple to nest YAML in an annotation in YAML.

So I wonder if we should support, either YAML encoding in the fabric8.io/json-schema annotation - or we make the ConfigMap code also detect fabric8.io/yaml-schema? for YAML encoded json schema? Then it'd be easier to hand-craft some json schema structure into ConfigMaps?

@gashcrumb
Copy link
Member

Yeah, it'd be pretty easy to do, we've already got a 'yaml to javascript object' converter available.

@gashcrumb
Copy link
Member

So I have this working nicely:

kind: ConfigMap
apiVersion: v1
metadata:
  name: spring-boot-webmvc
  namespace: default
  selfLink: /api/v1/namespaces/default/configmaps/spring-boot-webmvc
  uid: a2e4d692-7b4a-11e6-a421-bef25813b997
  resourceVersion: '26526'
  creationTimestamp: '2016-09-15T13:45:17Z'
  labels:
    group: io.fabric8.quickstarts
    project: spring-boot-webmvc
    provider: fabric8
    version: 1.0-SNAPSHOT
  annotations:
    fabric8.io/yaml-schema: |-
      properties:
        foo:
          type: string
        application_properties:
          type: string
data:
  application-properties: |
    # spring application proeprties file
    welcome = Hello from Kubernetes ConfigMap!!!
    dummy = some value
  foo: bar

@jstrachan
Copy link
Contributor Author

Lovely!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants