Closed cari-lynn closed 2 years ago
Reviewing this story with the team, got some feedback. Need to update the story to address these questions:
@doc/desc
, or other name @schema/desc
)description
key in the info
object?done β
re: @schema/desc
on a Document Node
Observations:
@schema/...
annotations on the document map to the properties of components.schema.dataValues
.title
and description
properties are also support/allowed in that set of properties.Suggestion:
components.schema.dataValues
info
section of values (e.g. @schema/info
?)That is a great idea, I created an issue to talk through your suggestion more https://github.com/vmware-tanzu/carvel-ytt/issues/539 @pivotaljohn
Updated the acceptance criteria to change if a data values schema is annotated at the document level:
#@schema/desc ""
---
then it applies to the section immediately following the component.schemas.dataValues
section.
As a Configuration Author I want to generate an Openapi description key from my configuration annotations so that Configuration Consumers see what the key's purpose is.
:green_circle: Scenario 1:
@schema/desc
annotation creates adescription
key for an mapGiven the following schema exists
When I execute
ytt -f schema.yml --data-values-schema-inspect -o openapi-v3
Then I should see on my screen:green_circle: Scenario 2:
@schema/desc
annotation creates adescription
key for an arrayGiven the following schema exists
When I execute
ytt -f schema.yml --data-values-schema-inspect -o openapi-v3
Then I should see a description on the ARRAY:green_circle: Scenario 3:
@schema/desc
annotation creates adescription
key for an array itemGiven the following schema exists
When I execute
ytt -f schema.yml --data-values-schema-inspect -o openapi-v3
Then I should see a description on the MAPπ Scenario 4:
@schema/desc
annotation is added to the description of the schema UPDATEDGiven the following schema exists
When I execute
ytt -f schema.yml --data-values-schema-inspect -o openapi-v3
Then no description is addedReasoning for placing the description there instead of in the
info
object: a Document in ytt is a map, this corresponds to the 'object' under thecomponents.schemas
section in the OpenAPI doc. Because of that, annotating a Document should apply that annotation to that level in an OpenAPI Doc.π΄ Scenario 5: When value is any type other than a string
Given the following schema exists
When I execute
ytt -f schema.yml --data-values-schema-inspect -o openapi-v3
Then I see an error (similar to overlay errors) that the value must be a stringπ΄ Scenario 6: When value is any type other than a string
Given the following schema exists
When I execute
ytt -f schema.yml --data-values-schema-inspect -o openapi-v3
Then I see an error (similar to overlay errors) that the value must be one stringExcerpt from the proposed Schema documentation
Sets the text describing the purpose of the node.
documentation
(string
) β a more thorough description of the node or section that shares the context of the node, enumerates the range of possible values, explaining the effects of certain value ranges.Links: