Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysl openapi spec import logic is nondeterministic #1060

Open
anz-rfc opened this issue Mar 3, 2021 · 0 comments
Open

sysl openapi spec import logic is nondeterministic #1060

anz-rfc opened this issue Mar 3, 2021 · 0 comments
Labels

Comments

@anz-rfc
Copy link

anz-rfc commented Mar 3, 2021

Description

The output model.json generated by importing api specs using sysl is a non-determinstic function of the input.

Running a command line sysl pb --mode json --root . specs/spec.sysl --output model.json on the same input API spec again and again can produce different output model.json files

instances where we have seen non-deterministic output in model.json

  1. calls to REST endpoints defined in open api specs where the spec defines multiple possible content-types for the request body. Sysl-go importer appears to arbitrarily pick one of the content-types to write to the output model.json. Issue isolated and logged as sysl openapi spec importer behaviour is nondeterministic if input open api spec defines multiple request bodies with differing content-types #1058

  2. Sysl-go importer regards schemas of query parameters as fungible between different endpoints with different schemas in some cases where the query parameters have the same name. This is wrong as well as producing nondeterministic behaviour. Issue logged as 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

steps to reproduce

see individual linked issues above

Expected behavior

importer is determinstic

Actual behavior

importer is not deterministic

@anz-rfc anz-rfc added the bug label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant