-
Notifications
You must be signed in to change notification settings - Fork 83
Clarify Extensible name (with/without x-) #339
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
Comments
@arthurdm - can you add this to the agenda for next meeting? |
I think accepting a key that starts with an What can be changed: if the name does not start with e.addExtension("custom", "value"); results in If we go this way, then to be consistent the same should be applied for And we should have TCK test for all combinations. As raised by @EricWittmann in smallrye/smallrye-open-api#77:
The problem raised here is just one of them... We could also agree to do nothing if the API is used wrongly. An other approach would be to accept the illegal value and report a validation issue. See: #331 |
I think this is a pretty good summary of the options! :) |
I believe the OAS3 says the extension keys |
It does, but I think the idea here is that the MP+OAI spec could support leaving out the |
I think my approach would be to leave it as-is but update the javadoc (if it's not already clear) to indicate that the extension key should begin with |
@arthurdm : (out of topic for this specific issue, but same idea when it comes to validation and/or enforcement) the spec also says for Paths Object: The field name MUST begin with a slash (e.g. |
That's an example of what I mean - there are many ways to mess up. Off the top of my head:
The list is very long. In Apicurio I currently have 127 separate validation rules just for Spec Compliance - and I'm sure I've missed some. Constructing a document from annotations or from a model reader would allow a user to violate pretty much any rule. So I think it's obvious that the MP platform can't be expected to enforce compliance. Instead, I think it goes back to the fact that platform impls should be able to provide validation of the generated document. |
sounds good, thanks guys. We can definitely chat about it in the next hangout. My only worry is that the mutation of an extension |
We reviewed this issue in the MP hangout last week. The consensus was that we would not do any automatic conversion of non We have two main reasons for this.
The best solution for this problem is for the platform to support validation of the resulting OpenAPI document. Optional validation support is something we will be adding to the MP+OAI spec in the near future. |
Note: I am leaving this open until we have reviewed the javadoc to ensure it is accurate and complete with respect to documenting If anyone strongly disagrees with the committee's decision on this matter, please don't hesitate to make your case! It would be best to join a future MP hangout to do this, but if you cannot attend the hangouts then you can make a case here. |
The plan is to update the JavaDoc as suggested above for the MP 3.1 milestone. |
With the same logic you could argue that static types in a language are "not needed" as developers have many ways (e.g. casts) to produce an invalid program. Why even have the compiler check it since there are many ways mess up, right?. Just saying. |
Uh oh!
There was an error while loading. Please reload this page.
The javadoc of
Extensible.addExtension
states:This can be understood in two ways:
x-
in its map.x-
. Does this mean other should be ignored?In the TCK examples the annotations use names with the
x-
prefix already in the name. I'd think that from the user perspective these should be plain names without thex-
as it is more readable and avoids using illegal names by design.The text was updated successfully, but these errors were encountered: