-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Header definition clashing with naming conventions #148
Comments
Hi @acabarbaye , There will be a new parameter for this, it has been added last week with this issue: #135 We should release a new version with this improvement somewhere next week. In the meantime, you can compile the code of the project in the master. Let me know if this new feature is ok for your use case. |
@acabarbaye It has been released in version 1.5. Please let us know if it's working for you and we will close this issue :) |
@JFCote : has version 1.5 made it to maven central or Jcenter?
Just to be sure I understand the new feature, for my case, I should define the following options?
|
@acabarbaye Oh! It seems the release didn't make its way to Maven. I will check with @jmini who did the release. Will update here when it's ready. As for your problem, I now see that it will not fix your issue because the naming of your header is not the same. At first glance, I thought that it was the same thing as #135 What you need would be an option to completely ignore the naming of headers. I will think about it. Maybe a new "naming strategy convention" that will be |
@acabarbaye There was a problem during the release, the 1.5 was lost. It has been generated again and it's there! https://repo1.maven.org/maven2/org/openapitools/openapistylevalidator/openapi-style-validator-lib/1.5/ |
… Also, finally removed the deprecated stuff since we have released at least 3 version since the deprecated warnings.
Perfect. |
@acabarbaye I created a PR last friday. It just needs to be reviewed and the feature should work. |
* Fix intellij meta data and configuration. WIP * fix #148: Add a new `anyCase` naming convention to ignore everything. Also, finally removed the deprecated stuff since we have released at least 3 version since the deprecated warnings. * Fix from code review
I have documented some official headers like Anyway, Can't we exclude official headers from the naming convention validation or include a naming convention that match the official "Hyphen-Upper-Case" ? And/or maybe ensure that official headers match the official naming convention ? Edit; The NullPointerException is gone with v1.6. |
@gervaisb Just to be sure, is it ok now or do you still have problems with the |
Well the issue with |
Hello. Can we reopen that issue ? I have tried the version 1.7 but the "Hyphen-Upper-Case" cause a NPE.
I would like to:
|
@gervaisb Issue reopened! |
I do not know what happened with 1.7, but I have made another attempt right now (Oct. 5 2021) and it seems that Anyway, I still have to update the README and manage the NullPointer. However, the NullPointerException occurs because Gson ignores unknown values for enums. So we have to either validate that there are no Whatever the choice, the Do you have any advice on where and how that validation should be implemented? |
Add this convention to the lists of naming conventions and describe the capability to validate the headers. Relates to OpenAPITools#148
* Fix 178, should not fail when there are no 'example' for a component * Update lib/src/main/java/org/openapitools/openapistylevalidator/OpenApiSpecStyleValidator.java little reformat * chore(doc): document the Hyphen-Upper-Case naming convention Add this convention to the lists of naming conventions and describe the capability to validate the headers. Relates to #148 Co-authored-by: Jean-François Côté <[email protected]>
The cli will now validate the naming conventions and report them trough an IllegalArgumentException with a detailed message instead of a NullPointerException. Relates to OpenAPITools#148 This commit will also fix a typo in `fixConventionRenaming`: "depre[a]cated"
* Fix 178, should not fail when there are no 'example' for a component * Update lib/src/main/java/org/openapitools/openapistylevalidator/OpenApiSpecStyleValidator.java little reformat * feat(cli): validate naming conventions The cli will now validate the naming conventions and report them trough an IllegalArgumentException with a detailed message instead of a NullPointerException. Relates to #148 This commit will also fix a typo in `fixConventionRenaming`: "depre[a]cated" Co-authored-by: Jean-François Côté <[email protected]>
Describe the bug
When describing header parameters which do not follow any naming convention such as
Accept-Version
orif-none-match
, I get naming convention errors for PATH and PropertiesTo Reproduce
e.g.
results in
*ERROR* in path GET /... 'Accept-Version' -> parameter should be in camelCase
*ERROR* in path GET / 'Accept-Version' -> parameter should be in camelCase
Expected behavior
No error raised for headers as we have no control over their naming
The text was updated successfully, but these errors were encountered: