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

extraneous elements are permitted due to use of allOf #162

Closed
catkins-miso opened this issue Sep 14, 2024 · 2 comments · Fixed by #209
Closed

extraneous elements are permitted due to use of allOf #162

catkins-miso opened this issue Sep 14, 2024 · 2 comments · Fixed by #209
Assignees
Labels
Discussion Inquiries that we want to have a record of for future reference. Can turn into "Spec Change" issues.

Comments

@catkins-miso
Copy link
Contributor

catkins-miso commented Sep 14, 2024

As identified in #158, examples in the spec can have elements that are not specified, and the linter doesn't catch them. This is because we cannot use additionalProperties: false to constrain the message schema as discussed here #158 (comment)

Unfortunately, the idea of using YAML merge, e.g., <<: *merge_token to hack our way out of this situation is not practicable, since most of the allOf uses also employ $ref inclusions, and YAML merge only supports same-file definitions.

It's important to note that the impact here isn't just the examples in the spec, but also the allowable messages in a TROLIE-conformant information exchange. Technically, the spec currently allows any number of spurious properties to be included in a message. Tools like 42crunch explicitly warn about this, but we've necessarily ignored them for these allOf properties.

AFAICT, that leaves us with the options of:

  • moving to OpenAPI 3.1.0 for access to unevaluatedProperties: false,
  • or repeating several schema definitions where they are reused,
  • or eliminating the entire split/combine step and editing on giant openapi.yaml.

I cannot really evaluate the cost of moving to OpenAPI 3.1.0 without feedback from current and potential implementors, but we originally wanted to provide the broadest support possible for the API client generators, and unfortunately some popular tools do not support it.

@catkins-miso catkins-miso added the Discussion Inquiries that we want to have a record of for future reference. Can turn into "Spec Change" issues. label Sep 14, 2024
@catkins-miso
Copy link
Contributor Author

FWIW, the impetus for creating this issue was finding another instance of an extraneous element

catkins-miso added a commit that referenced this issue Sep 16, 2024
catkins-miso added a commit that referenced this issue Nov 5, 2024
see extraneous elements are permitted due to use of `allOf` #162
catkins-miso added a commit that referenced this issue Nov 6, 2024
see extraneous elements are permitted due to use of `allOf` #162
@catkins-miso
Copy link
Contributor Author

The yaml merge in the recdocly tooling supports multiple refs, i.e., <<: [*ref1, ref2]. Using this allowed us to consolidate many files into period-limit.yaml and removing all uses of allOf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Inquiries that we want to have a record of for future reference. Can turn into "Spec Change" issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants