Releases: apiaryio/fury-adapter-swagger
0.22.7
Bug Fixes
-
Adds support for generating JSON bodies for schemas where the root is an
array. For example, given following array schema:type: array items: type: string example: Doe
The parser will now generate a JSON body of
["Doe"]
whereas in previous
versions would've resulted in an empty array. -
Fixes parsing Swagger documents that contain properties called
$ref
.
Previously the parser would attempt to dereference the property as would
generically try to dereference any key in an object called$ref
, as per the
JSON Schema specification, references are only permitted when a schema type
is expected.For example, the following is a schema which is trying to describe an object
with a property called$ref
, previously the parser would attempt to
dereference$ref
and crash in the process.type: object properties: $ref: type: string example: '#/definitions/User' required: ['$ref']
There is a still an open known issue
#235 that
uses of$ref
in a Swagger 2 document where the value a string will cause
the parser to attempt to dereference it incorrectly when the$ref
property
is found on an object that does not support$ref
as per the Swagger 2 and
JSON Schema specifications.
0.22.6
Enhancements
-
While generating a data structure from a Swagger Schema, we will now attempt
to infer when the schema should be an object but the user has forgotten to
puttype: object
by looking for the presence ofproperties
in the schema. -
Adds support for object inheritance and mixins via
allOf
referencing in
data structure generation.For example, the following will create an object which inherits from
User
:allOf: - $ref: '#/definitions/User' - properties: id: type: string
Secondly, when you reference multiple objects using
allOf
they will be
treated as mixins:allOf: - $ref: '#/definitions/BaseUser' - $ref: '#/definitions/UserMixin'
Bug Fixes
-
Fixes using
x-nullable
in a schema which previously caused the schema not
to be converted to a data structure. For example, the following schema
wouldn't result in a data structure:type: string x-nullable: true
-
Fixes some cases where rendering a JSON example from a Swagger Schema using
example values which contain references would fail.
0.22.4
0.22.3
0.22.2
0.22.1
Bug Fixes
- Fixes a regression introduced in 0.22.0 where the parse result may contain
invalid references inside a JSON Schema for example values if they used
references. This regression also caused$ref
to be incorrectly present in
Data Structure sample values.
0.22.0
Enhancements
- Adds a dataStructures section to the parse result containing every data structure found within the definitions section of a Swagger document. We now use referencing between data structures found within a request or response data structure which generally makes parse results smaller instead of duplicating the data structure contents.
Bug Fixes
- Adds support for primitive request bodies.
0.21.1
0.21.0
Enhancements
- Line and column numbers are now exposed in the parse result in source maps
for annotation elements.
Bug Fixes
-
Default and example values for headers are now validated to match the header
type. For example, placing a string as a value for a number type header will
now emit a warning. -
Header values will now contain source map information in the parse result.
-
Fix support for type
file
in multipart-form body generation.
0.20.0
Enhancements
-
The API Version is now exposed in the parse result. The API category now
contains a version attribute including the API version. -
Circular references are now supported in schemas and JSON and JSON Schemas
will now be present in parse results when you use circular references.
Bug Fixes
- Example values in a Schema Object will now be placed into the dataStructure
as a value instead of inside samples in cases where there isn't already a
value.