-
Notifications
You must be signed in to change notification settings - Fork 557
Fix nested message object in API responses #12097
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
Merged
Merged
Changes from 28 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7911c63
Fix nested message object in API responses #12096
ErykKul 2e43bd7
Fix integration tests and add API changelog entry
ErykKul 0a9ce32
Fix RST reference syntax in changelog
ErykKul 0ba746a
Merge develop into 12096-fix-ok-message-nested-object
ErykKul bd27aaf
Add feature flag for legacy API message format
ErykKul 18f42aa
refactor(api): remove redundant `this.` qualifier in `BatchImport.java`
poikilotherm aa1a295
refactor(api): move constants from `AbstractApiBean` to `ApiConstants…
poikilotherm e13bd34
refactor(api): consolidate `ok()` response methods and simplify retur…
poikilotherm 15acb22
refactor(api): add legacy message field support for ok(String) respon…
poikilotherm f89293b
refactor(api): simplify `ok(String, JsonObjectBuilder)` response crea…
poikilotherm 1f83f65
refactor(settings): migrate `API_MESSAGE_FIELD_LEGACY` flag to `JvmSe…
poikilotherm f475099
refactor(api): unify all API response message styles with feature flag
poikilotherm 6403498
fix(api): ensure `JsonObjectBuilder` is built before adding to response
poikilotherm aba0301
test(util): add `@FeatureFlag` extension for test-time feature flag m…
poikilotherm 83c484b
test(api): add `@FeatureFlag`-annotated test for unified message style
poikilotherm f58b469
docs(api,configuration): document message field style with new unifie…
poikilotherm 8f80e9c
fix(api): remove trailing space from MESSAGE_FIELD constant
poikilotherm 47dece5
docs(release-notes): update API message field changes and unify flag …
poikilotherm df40e5f
Merge branch 'develop' into 12096-fix-ok-message-nested-object
ErykKul 8d06cb4
Cimpilation error fix
ErykKul b51ae29
Fix JSON field extraction for nested objects and add tests for respon…
ErykKul 3d4e841
Enhance error handling in BatchImport: log I/O exceptions and prevent…
ErykKul af79e3f
Update doc/sphinx-guides/source/api/changelog.rst
ErykKul d01b6b6
Update doc/release-notes/12096-fix-ok-message-nested-object.md
ErykKul a974dbb
Reverted; out of scope of this PR, and the fails in the tests might b…
ErykKul f882e11
Revrted error handling in BatchImport
ErykKul 2a60336
Merge remote-tracking branch 'refs/remotes/origin/12096-fix-ok-messag…
ErykKul b5a0406
reverted test fix
ErykKul ec49f15
Merge branch 'develop' into 12096-fix-ok-message-nested-object
ErykKul b99691d
Merge branch 'develop' into 12096-fix-ok-message-nested-object
ErykKul 7e28ebf
Merge branch 'develop' into 12096-fix-ok-message-nested-object
ErykKul 4613117
Merge branch 'develop' into 12096-fix-ok-message-nested-object
sekmiller accf973
Merge branch 'develop' into 12096-fix-ok-message-nested-object
pdurbin fb9f084
move changes to correct upcoming version #12096
pdurbin 6185faf
link to config option #12096
pdurbin 2551048
fix version it will ship in #12096
pdurbin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ### API Response Format Fix for `message` Field | ||
|
|
||
| The `message` field in API responses from certain endpoints was incorrectly returned as a nested object (`{"message": {"message": "..."}}`) instead of a plain string (`{"message": "..."}`). | ||
|
|
||
| This has been fixed. The following endpoints now return the `message` field as a string, consistent with all other API responses: | ||
|
|
||
| - `POST /api/datasets/{id}/add` (when uploading duplicate files) | ||
| - `PUT /api/admin/settings` | ||
| - `PUT /api/dataverses/{id}` | ||
| - `PUT /api/dataverses/{id}/inputLevels` | ||
| - `POST /api/admin/savedsearches` | ||
| - `PUT /api/harvest/clients/{nickName}` | ||
| - `PUT /api/harvest/server/oaisets/{specname}` | ||
|
|
||
| **Note:** If you have integrations that implemented workarounds for the nested `message` object, you may need to update your code to expect a plain string instead. | ||
| If you need time to update your integrations, you can temporarily revert to the legacy behavior by setting this JVM option: | ||
|
|
||
| ``` | ||
| dataverse.legacy.api-response-message-style=true | ||
| ``` | ||
|
|
||
| This flag will be removed in a future version. | ||
|
|
||
| **Note:** As of this version, there is also an experimental opt-in feature that will align API responses on about 230 more occasions. | ||
| In these responses, the message is embedded into the "data" field as a nested object. | ||
| If you want to test your integrations and clients, please enable the `dataverse.feature.unify-api-response-message-style` feature flag. | ||
| In a future version of Dataverse, this now experimental style is going to become the supported default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.