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
sysl openapi spec importer behaviour assumes query params of different endpoints with the same name have the same schema, and non-deterministically picks a schema for them both to use
#1059
sysl openapi spec importer behaviour assumes query params of different endpoints with the same name have the same schema, and non-determinstically picks a schema for them both to use
Steps to Reproduce
The following example is hand-minimised from a real API spec.
Create files specs/poc2.sysl and specs/items.yaml as follows:
update: see comment below, this has a simpler example that is a valid swagger 2.0 document that can reproduce the same defect
Caveat -- issue with above example
according to swagger editor, the items.yaml spec isn't a valid swagger 2.0 document, there are two errors:
Structural error at paths./items.get.parameters.0.items
should NOT have additional properties
additionalProperty: $ref
Jump to line 21
Structural error at paths./items/{itemCode}.get.parameters.1.items
should NOT have additional properties
additionalProperty: $ref
Jump to line 44
Expected behavior
sysl importer output is deterministic
output model.json uses correct items schema for each endpoint
Actual behavior
sysl importer output is nondeterministic
output model.json incorrectly uses a single arbitrarily-chosen items schema for both endpoints
Your Environment
$ sysl info
Build:
Version : v0.254.0
Git Commit : a5a64cd82c67781f94fe5dd75b846b6446b2783c
Date : 2020-10-25T23:53:41Z
Go Version : go1.14.8 darwin/amd64
OS : darwin/amd64
note: this problem appears present with sysl-go 0.175.0 and sysl-go 0.180.0, which internally use sysl version 0.258.0
The text was updated successfully, but these errors were encountered:
anz-rfc
changed the title
sysl openapi spec importer behaviour assumes query params of different endpoints with the same name have the same schema, and non-determinstically picks a schema for them both to use
sysl openapi spec importer behaviour assumes query params of different endpoints with the same name have the same schema, and non-deterministically picks a schema for them both to use
Mar 3, 2021
both endpoints have an optional query parameter named x. one endpoint requires that x, if given, be an array of string. the other endpoint requires that x, if given, be an array of number.
when sysl importer is run it produces a model.json that arbitrarily picks one of the schemas and uses them for both endpoints, which is both nondeterministic and defective
Description
sysl openapi spec importer behaviour assumes query params of different endpoints with the same name have the same schema, and non-determinstically picks a schema for them both to use
Steps to Reproduce
The following example is hand-minimised from a real API spec.
specs/poc2.sysl
andspecs/items.yaml
as follows:observe that the Item Catalog API spec defines two endpoints -- each has a query parameter named "include" with a different schema.
model.json
a bunch of times using the importer:update: see comment below, this has a simpler example that is a valid swagger 2.0 document that can reproduce the same defect
Caveat -- issue with above example
according to swagger editor, the
items.yaml
spec isn't a valid swagger 2.0 document, there are two errors:Expected behavior
Actual behavior
Your Environment
note: this problem appears present with sysl-go 0.175.0 and sysl-go 0.180.0, which internally use sysl version 0.258.0
The text was updated successfully, but these errors were encountered: