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

Improve swagger/openapi specs and schemas #582

Open
RickMoynihan opened this issue Feb 24, 2022 · 0 comments
Open

Improve swagger/openapi specs and schemas #582

RickMoynihan opened this issue Feb 24, 2022 · 0 comments

Comments

@RickMoynihan
Copy link
Member

RickMoynihan commented Feb 24, 2022

I’ve been using martian with drafter and I think drafters swagger schema could use some work to help improve openapi clients interop with it.

We should carefully consider backward compatibility, but there are some issues with the schemas. Many of them could be more much more precise, some are essentially set to “Any”; which blows the ability for martian.test to generate property based data from the schema specs.

Some crude experiments can be found here.

Areas for exploration and consideration

As a pre-requisite to the above the drafter martian client in that project could be ported into drafter, and cleaned up a little. This client has some advantages over the current one:

  1. It uses martian/openapi data directly, and uses martian as the interface to drafter. Where as the existing client hides martian by wrapping it behind its own functions.
    • This makes it harder to extend
    • It's harder to use the machinery martian exposes for example based testing, vcr's, and also deriving property based tests from the swagger specs.
    • A martain based client will not need regenerating as drafters API itself evolves, as most of the improvements will be driven by the schemas evolution.
  2. Once this client is in place, we could use it develop and iterate the swagger schema itself. Additionally we may want to use it to drive developments into martian, martian.test and the underlying schema-generator library. e.g. my experiments above showed that martian was lacking this feature. This is important because currently the swagger spec forms our contract with the outside world; but we don't really test it at the schema level itself; so it's difficult to know how good/usable our schema is for other clients.
  3. Finally we can consider deprecating the existing client
  4. Similarly we should probably make similar changes to the swirrl/auth0 library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant