Skip to content

Fixed: ModelApiReader resolved omitted auth/publish attributes to false, opposite of rest-api.xsd's declared default - #408

Merged
mridulpathak merged 2 commits into
apache:release24.09from
mridulpathak:rest-api-secure-defaults-release24.09
Sep 17, 2026
Merged

mridulpathak merged 2 commits into
apache:release24.09from
mridulpathak:rest-api-secure-defaults-release24.09

Conversation

@mridulpathak

@mridulpathak mridulpathak commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

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.

…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.
@sonarqubecloud

Copy link
Copy Markdown

@mridulpathak
mridulpathak merged commit 0447d58 into apache:release24.09 Sep 17, 2026
2 checks passed
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.

1 participant