You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swagger-parser 2.0.21 will produce a JSON pointer to id property as /paths/~1pets/get/responses/200/content/application~1json/schema/properties/id
swagger-parser 2.0.22+ will produce a JSON pointer to id property as /components/schemas/CustomId.
The reason for this is that swagger-parser flattens schemas by replacing schema with a reference with an actual schema. This behaviour breaks the AST reference builder.
The text was updated successfully, but these errors were encountered:
The reason why Zally gets the wrong JSON pointer is because swagger-parser reassigns the same schema instance to the property during the resolution. Zally uses object identities to get JSON pointers for OpenAPI object. In the example above the resolved API will look like this:
openapi: 3.0.1paths:
/pets:
get:
responses:
200:
content:
application/json:
schema:
properties:
id:
# This part is an identical object as "CustomId" belowtype: integerformat: int64components:
schemas:
CustomId:
type: integerformat: int64
The problem is related to how Swagger parser makes full schema resolution. Check the resolveFully example. In this case JSON pointers map based on identities will point wrong instances.
This is not a bug in Zally, but fixing a bug in the parser leads to different JSON pointers resolution in some cases. Will close this, because there is nothing to fix.
Schema
swagger-parser 2.0.21 will produce a JSON pointer to
id
property as/paths/~1pets/get/responses/200/content/application~1json/schema/properties/id
swagger-parser 2.0.22+ will produce a JSON pointer to
id
property as/components/schemas/CustomId
.The reason for this is that
swagger-parser
flattens schemas by replacing schema with a reference with an actual schema. This behaviour breaks the AST reference builder.The text was updated successfully, but these errors were encountered: