Closed klokane closed 4 years ago
~If I understand correctly, there is no API Blueprint syntax which would trigger a const
value in a JSON Schema (so some of the const code won't be executed as unreachable code). Should we update the JSON Schema optimisation logic at https://github.com/apiaryio/drafter/blob/klokane/json-schema-draft7/src/refract/JsonSchema.cc#L466 so that when enum
is a single value it will use const
instead?~
Edit: I think I missed part
Maybe best solution check will be go thru commit https://github.com/apiaryio/drafter/pull/771/commits/2dc67272054d6debf64854489400e62ed7e64b45
If all changes are conforming to const
definition.
I created separated commit, just with changes related to enum-const conversion
I go thru and mean it is okay
Implements transformation "one element enum" to "const" as defined in JSON schema draft 06
https://json-schema.org/draft-06/json-schema-release-notes.html