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

Allow resolution of external references on OpenAPI file #548

Closed
lbroudoux opened this issue Jan 20, 2022 · 2 comments
Closed

Allow resolution of external references on OpenAPI file #548

lbroudoux opened this issue Jan 20, 2022 · 2 comments

Comments

@lbroudoux
Copy link
Member

lbroudoux commented Jan 20, 2022

As of today, we have a reference resolution mechanism that is used on import time for AsyncAPI spec file. This has been added in #306 in order to support Avro schema references. It also has been used later on for gRPC support addition (one protobuf file may referenced other external protobuf files).

For unknown reasons, it hasn't been added to OpenAPI support yet. However, referencing JSON Schema files from OpenAPI files is now a very common practice (though I personally think that you then have to be very cautious on how you manage versioning of everything 😉 )

We should had this reference resolution mechanism for OpenAPI.

It means that references will be discovered at import time but I see options on how to implement it:

  1. Do not modify OpenAPI file and add extra contracts for JSON Schema to keep everything "as is". This mean that during tests we'll have to dereference everything and create an inlined OpenAPI spec in order to ease validation,
  2. Dereference everything at import time and modify OpenAPI file. This mean that we'll not have to touch everything during tests and it'll speed up things. However, user could be lost seing the import result mentioning only 1 OpenAPI file,
  3. Dereference everything at import time and modify OpenAPI file, but also add extra contracts for JSON Schema to prove we discovered everything.

What do you think? Do you see any other alternatives?

My personal preference goes to #3 that could be a nice trade-off. Let me know!

@lbroudoux
Copy link
Member Author

Hi @redben! Feature is now ready. If you want to put out some tests....

@redben
Copy link

redben commented Mar 1, 2022

Nice! Thanks I'll try it out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants