RepreZen / KaiZen-OpenApi-Parser

High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x
130 stars 31 forks source link

ZEN 4322: OAS3 Validation: Update current parser and validations to latest OpenAPI spec #182

Closed tfesenko closed 6 years ago

tfesenko commented 6 years ago

[Targeting task/180]

Updated Parser for OAS 3.0.1 (types3.yaml)

Note: I did NOT generate-sources from types3.yaml as the diff produced by the generator is suspiciously big, I am using jsonoverlay-3.0.2-201808131204 . I will gladly regenerate them if you point me to the right version of Json Overlay

Server Variable

From https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#serverVariableObject:

enum [string] An enumeration of string values to be used if the substitution options are from a limited set.

default string REQUIRED. The default value to use for substitution, and to send, if an alternate value is not supplied. Unlike the Schema Object's default, this value MUST be provided by the consumer.

Link

From https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#linkObject:

requestBody Any | {expression} A literal value or {expression} to use as a request body when calling the target operation.

Schema

From https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#schemaObject: No "examples" (plural), only "example"(singular):

example Any A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.

Updated Validator

See d0cb178

andylowry commented 6 years ago

@tfesenko Thanks for your work on this. As we discussed earlier, due to my simultaneous work on the validation framework, this PR was unmergeable. However, I've made all the indicated changes in context of the new framework, using your PR as a guide.

My work was done in #187

I'll close this PR now.