apiaryio / drafter

API Blueprint Parser (C++)
https://apiblueprint.org/
MIT License
302 stars 54 forks source link

Switch to JSON Schema Draft 7 #771

Closed klokane closed 4 years ago

klokane commented 4 years ago

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

kylef commented 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

klokane commented 4 years ago

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

klokane commented 4 years ago

I go thru and mean it is okay