RepreZen / KaiZen-OpenApi-Parser

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

Use smarter defaults in type specification #124

Closed andylowry closed 6 years ago

andylowry commented 6 years ago

It's pretty annoying to constantly have to write stuff like this in the types specification:

    description:
       name: Description
       type: String

The property key above is the field's id value, and is the default for it path within its containing object. The name should also have an intelligent default based on the id, and settling on String as the default would make things additionally concise.

For name default, the following rules will apply:

andylowry commented 6 years ago

Implemented in #125

andylowry commented 6 years ago

As described in #125, defaulting a missing type to "String" was altered to retain existing default behavior (which I had forgotten about). Rules for a missing field type are now: