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

Tighten extension model #202

Open
dret opened this issue Jun 10, 2024 · 12 comments
Open

Tighten extension model #202

dret opened this issue Jun 10, 2024 · 12 comments

Comments

@dret
Copy link

dret commented Jun 10, 2024

It seems that Arazzo's extension model is a copy of OpenAPI:

It always seemed like OpenAPI's extension model should be tightened, and maybe at least for Arazzo we can still do it? Here are two things that I think should go into almost every extension model that tries to be both open and safe:

  • Extensions must always be safe to ignore, i.e. when interpreting or processing a description using an extension then it has to be safe to ignore the extension.
  • Extensions are not allow to alter the semantics for anything other than their own scope, i.e. they cannot change any semantics of the base specification and they also cannot change the semantics of other extensions.

In the end, I would argue that we're simply applying the principles of good API design to our own spec.

@vanto
Copy link

vanto commented Jun 10, 2024

If extensions are intended to extend the operational semantics, this may not be enough. In this case, it may be necessary to declare extensions at the beginning and express ignorability with a mustUnderstand flag or similar.

@dret
Copy link
Author

dret commented Jun 10, 2024 via email

@frankkilcommins
Copy link
Collaborator

@dret - Generally, I am in favour of adding such statements/guidance for extension authors. We also should determine if we need structural changes to the extension registry to indicate what specification an extension is applicable for.

@dret
Copy link
Author

dret commented Jun 11, 2024 via email

@dret
Copy link
Author

dret commented Jun 11, 2024 via email

@handrews
Copy link
Member

@dret some registries might be spec-specific, but others definitely are not. The format registry, for example, isn't even OAI-specific, much less OAS-specific. If the media type modeling registry I've proposed is accepted, that's not spec-specific either. It's already true that extension keywords are not just spec-specific but also Object-specific. The best thing is probably to just add a column scoping the entries.

make the registry concept more open anyways

What would this mean? All you need to do to add to then is open a PR, that seems pretty open to me.

@dret
Copy link
Author

dret commented Jun 11, 2024 via email

@dret
Copy link
Author

dret commented Jun 11, 2024 via email

@handrews
Copy link
Member

@dret

more an OpenAPI registry (because registry issues/PRs go directly to the OpenAPI spec and not some separate registry repo)

We're already working on that! spec.openapis.org is run off of the gh-pages in that repo because GitHub used to require that. First we are moving it to a directory on main in the same repo, then we are 99% likely to make it its own repo specifically to make it symmetric for all specifications. @frankkilcommins is involved in that discussion.

But the idea is that spec.openapis.org is where all OpenAPI Initiative projects publish their specifications and registries. The registries are emphatically not intended to be OAS-specific. They just look like that because we don't have enough people with enough time to have done all the things we plan to do (although @Bellangelo is doing an amazing job with this work and has made tons of progress in the last few weeks - he's got the PR for moving out of the special branch open right now, and that will be a huge step for us).

@dret
Copy link
Author

dret commented Jun 12, 2024 via email

@handrews
Copy link
Member

@dret in today's TDC call we agreed to make it a separate repository. Exactly when and how that happens is still up in the air and depends on what @Bellangelo thinks will be easiest.

@dret
Copy link
Author

dret commented Jun 13, 2024 via email

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

4 participants