Closed cari-lynn closed 2 years ago
Given the following schema exists
#! data.yml #@data/values --- foo: bar
When I execute ytt tools generate schema --type jsonschema -f data.yml Then I should see on my screen
ytt tools generate schema --type jsonschema -f data.yml
--- "$id": https://carvel.dev/ytt/schema.jsonschema.yml "$schema": https://json-schema.org/draft/2020-12/schema "@id": "ytt:data.yml" type: object additionalProperties: false properties: foo: type: string default: bar
#! data.yml #@data/values --- foo: int_key: 10 bool_key: true null_key: null false_key: false string_key: some text inner_map: float_key: 9.1
--- "$id": https://carvel.dev/ytt/schema.jsonschema.yml "$schema": https://json-schema.org/draft/2020-12/schema "@id": "ytt:data.yml" type: object additionalProperties: false properties: foo: type: object additionalProperties: false properties: int_key: type: integer default: 10 bool_key: type: boolean default: true null_key: type: "null" default: null false_key: type: boolean default: false string_key: type: string default: some text inner_map: type: object additionalProperties: false properties: float_key: type: number default: 9.1
Given the following file exists
#! template.yml --- foo: some value
When I execute ytt tools generate schema --type jsonschema -f template.yml Then I should see on my screen
ytt tools generate schema --type jsonschema -f template.yml
Error: Unable to generate a schema from input files Hint: Provide a file with a Schema or Data Values to generate the JSONSchema representation
note: updated error text to include data values.
OpenAPI spec
I am closing this story in favor of n issue that combines generating a OpenAPI Schema from the merged Data Values Schema and Data Values files. So there is no need to separate the issues at this time.
:green_circle: Scenario 1: Convert Inferred Schema with Map and String to JSONSchema
Given the following schema exists
When I execute
ytt tools generate schema --type jsonschema -f data.yml
Then I should see on my screen:green_circle: Scenario 2: Convert Inferred Schema with Map of Maps to JSONSchema
Given the following schema exists
When I execute
ytt tools generate schema --type jsonschema -f data.yml
Then I should see on my screen:red_circle: Scenario 3: Fails when no Data Value file provided
Given the following file exists
When I execute
ytt tools generate schema --type jsonschema -f template.yml
Then I should see on my screennote: updated error text to include data values.
OpenAPI spec