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

Spring doc API for index should return a structured object instead of JSONObject #7584

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

ianwallen
Copy link
Contributor

@ianwallen ianwallen commented Dec 29, 2023

API should return a structured object instead of JSONObject
Updated indexer to return an object IndexResponse instead of JSONObject

This was causing a couple issues.
1 - JSONObject is a weird object to be returned from an API when the results are really a String.
2 - There were a couple API's that were returning JSONObject but not the same one. One was net.sf.json.JSONObject and the other was org.json.JSONObject. This was causing a conflict in the SpringDoc API which was causing bugs in the open api specification. The JSONObject schema could change on each application restart.
3 - It was causing issues when trying to use CodeGen as it has issue using JSONObject objects as it conflict with the normal JSONObject.

This fix updates the indexer so that it returns a new IndexResponse object.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests)
  • User documentation provided for new features or enhancements in mannual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

Updated indexer to return an object IndexResponse instead of JSONObject
@josegar74 josegar74 merged commit 5fb3196 into geonetwork:main Jan 2, 2024
6 checks passed
josegar74 pushed a commit that referenced this pull request Jan 2, 2024
Updated indexer to return an object IndexResponse instead of JSONObject
@ianwallen ianwallen deleted the fix_index_json_results branch January 2, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants