-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Fix duplicate operation id caused by use of 2 methods GET/POST method from getKeywordById api #7586
Conversation
A get method should not generally support a POST? It caused duplicates duplicate OperationID that would occur (getKeywordById and getKeywordById_1)
services/src/main/java/org/fao/geonet/api/registries/vocabularies/KeywordsApi.java
Show resolved
Hide resolved
1775f71
to
69d09a2
Compare
"Use POST method if you want to support larger parameters list" | ||
) | ||
@RequestMapping( | ||
path = "/keywordById", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to keep GET unchanged because it is used in all records when XLink mode is enabled in a catalogue (so it will avoid migration in metadata records). And we can change POST (with keywordByIds
) and its (probably only) usage in https://github.com/geonetwork/core-geonetwork/blob/main/web-ui/src/main/resources/catalog/components/utility/UtilityService.js#L709-L710. Then it looks good. @josegar74 can you think of any other usages of this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fxprunayre
Sorry - I had accidently changed the endpoint to /keywordById. I reverted it back to /keyword for both get and post.
… from getKeywordById api (#7586) * Remove POST method from getKeywordById. api [BP] A get method should not generally support a POST? It caused duplicates duplicate OperationID that would occur (getKeywordById and getKeywordById_1) * Re added POST method for keyword and depreciated the GET api. * Use common private getKeyword function for both api calls. * Revert endpoint back to /keyword for GET
An api should not do GET/POST in the same operation as it seems to cause issues in open api specification document.
It caused duplicates duplicate OperationID that would occur (getKeywordById and getKeywordById_1)
This PR will split 2 OperationID (getKeywordById and getKeywordByIds)
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation