openapi-enforcer
Advanced tools
Changelog
1.17.2
Allow Two Similar Yet Distinct Paths When Methods Do Not Collide
Before this fix you could define two OpenAPI paths with the same path parameter location and different methods, but when attempting to match a path to a request the second path would be unreachable. This fix resolves the issue, allowing both paths to be found.
Changelog
1.17.1
Lookup $ref Value Only When $ref is a string
Previously any objects with a $ref
property would treat the value of the $ref
as a reference to resolve regardless of the value assigned to the $ref
property. Now there is a check that makes sure that the value assigned to the $ref
property is a string prior to attempting to look up the reference.
Changelog
1.17.0
Examples Warn of Additional Properties
For a schema, the default behavior of an object is to allow additional properties. This can be problematic when examples have additional properties that the schema does not define. Now there is a global config option Enforcer.config.examplesWarnAdditionalProperty
that defaults to true
and will warn of examples with additional properties. To disable this behavior set the global config property to false
.
Changelog
1.16.1
Improved README
The README now includes a few common usage examples and has the website link more prominent.
Changelog
1.16.0
All functionality should be the same as before, but due to the types of changes we're making this a minor release instead of a patch.
Improved JSON Ref Resolution
There has been a built-in JSON schema ref resolver for some time now, but it has not been the default. This has now been made both the default and the only option for ref resolution allowing the json-schema-ref-parser
dependency to be removed.
This ref resolver is slightly better than the generic json-schema-ref-parser
because it recognizes references in OpenAPI (and Swagger) documents that are not identified by the $ref
property. As an example, discriminators have non $ref
references.
Removed axios Dependency
This dependency was only used for HTTP/S GET requests. Now the core NodeJS http
or https
library is being used instead.
Remove json-schema-ref-parser Dependency
See the first bullet point of this change entry.
Added js-yaml Dependency
The built-in json schema reference parser uses js-yaml. Previously it was using the js-yaml dependency that was included by the json-schema-ref-parse, but with that gone we had to add it in as a dependency.
Changelog
1.15.5
Deserialized Byte Examples Cannot Be Frozen
If an example was given for format type "byte" then when the enforcer would deserialize that value to a Buffer. One deserialized it would attempt to freeze the object, but Buffers cannot be frozen and this would throw an error. Now Buffers will not attempt to be frozen.
Changelog
1.15.4
Fixed Case-Sensitivity Issue with Response Headers
Response headers that had anything except lowercase values would incorrectly not run through validation. Thanks to @dziegelbein for the PR that included the issue, fix, and tests.
Changelog
1.15.2
TypeScript Types Issues
TypeScript definition still had some issues, so I've simplified it for now. Looking forward to OpenAPI Enforcer version 2 which is being built with TypeScript.