Fixed: ModelApiReader resolved omitted auth/publish attributes to false, opposite of rest-api.xsd's declared default - #408
Merged
mridulpathak merged 2 commits intoSep 17, 2026
Conversation
…se, opposite of rest-api.xsd's declared default Backport of the trunk fix (apache/ofbiz-framework#2011) to the pre-move rest-api plugin here: ModelApiReader parsed an omitted auth or publish attribute via Boolean.parseBoolean(""), which resolves to false, while rest-api.xsd declares both attributes default="true", and OpenApiResource had no @secured binding of its own. Both are fixed the same way as on trunk, adapted to this branch's javax.ws.rs and org.apache.ofbiz.ws.rs.security.Secured layout.
Gating GET /rest/openapi.json behind auth conflicts with how Swagger UI's own Authorize flow works: it assumes the spec is viewable before a client has a token, since that's where a developer discovers how to obtain one in the first place. Leaving OpenApiResource unauthenticated, as it was before this fix, keeps that flow intact.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Backported from trunk (apache/ofbiz-framework#2011).
Manually re-applied rather than cherry-picked: on release24.09, rest-api still lives as a plugin here (javax.ws.rs) rather than framework/rest-api's later Jakarta-based layout, so the fix is reproduced against that version of ModelApiReader.