Skip to content

[schema] Application Service Registration meta schema #2132

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

V02460
Copy link
Contributor

@V02460 V02460 commented Apr 9, 2025

Sets the meta schema for the Application Service Registration to https://json-schema.org/draft/2020-12/schema. Specifying the meta schema clarifies the semantics of the schema files and allows tools to consume it correctly.

It seems to me that the registration.yaml and namespace_list.yaml are completely disjunct from the other OpenAPI schemas in the data/api/application-service folder. Because the other files follow OpenAPI v3.1.0, I still chose to use JSON Schema version 2020-12, which is the version that OpenAPI v3.1.0 data types and schema objects are based on.

Relevant parts of the OpenAPI v3.1.0 spec that justify the inclusion of the $schema keyword:

[The Schema Object] is a superset of the JSON Schema Specification Draft 2020-12.

Unless stated otherwise, the property definitions follow those of JSON Schema and do not add any additional semantics.

From https://spec.openapis.org/oas/v3.1.0.html#schema-object

Pull Request Checklist

V02460 added 2 commits April 9, 2025 10:39
Signed-off-by: Kai A. Hiller <git@kaialexhiller.de>
Signed-off-by: Kai A. Hiller <git@kaialexhiller.de>
@V02460 V02460 requested a review from a team as a code owner April 9, 2025 09:05
@tulir
Copy link
Member

tulir commented May 27, 2025

There don't seem to be $schemas in any of the files currently. If we add it, it should probably be consistent everywhere rather than just in 2 files

@V02460
Copy link
Contributor Author

V02460 commented May 27, 2025

@tulir: I don’t think that is necessary. These two files are special in that they

a) are useful as JSON Schema files independently of OpenAPI definitions. While OpenAPI has well-defined implicit meta schemas, that’s not the case for JSON Schemas.
b) are not actually used by any of the OpenAPI files – I think they were simply snuck in there for lack of a better location.

@KitsuneRal
Copy link
Member

KitsuneRal commented Jul 2, 2025

I agree that OpenAPI files don't necessarily need that because they have their own schema version designator already. However, we also have event schemas written as JSON Schema files (despite them having .yaml extension); point a) certainly applies to them as well. Point b) is rather irrelevant: the rationale of adding schema to JSON Schema files (clearer semantics and tooling-friendliness) is the same regardless of where they are located.

Would you be willing to extend the PR to other JSON Schema files under data? Would actually be interesting to see if specifying the schema would break anything.

Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be willing to extend the PR to other JSON Schema files under data? Would actually be interesting to see if specifying the schema would break anything.

@V02460 what do you think?

@V02460
Copy link
Contributor Author

V02460 commented Jul 15, 2025

Thanks for the ping :) Are we talking about the files under data/event-schemas and data/schemas? I could add meta schemas for them, too.

@KitsuneRal
Copy link
Member

Both; but event-schemas are most interesting.

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

Successfully merging this pull request may close these issues.

4 participants