Skip to content

Add Thingifier API spec and entity views - #84

Merged
eviltester merged 1 commit into
masterfrom
codex/thingifier-api-spec-views
Jul 28, 2026
Merged

Add Thingifier API spec and entity views#84
eviltester merged 1 commit into
masterfrom
codex/thingifier-api-spec-views

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Summary

  • add ThingifierApiSpec route rules for disabling/hiding, auth metadata, docs overrides, and entity view binding
  • add entity views with independent response visibility and request input policy
  • project view-aware docs, OpenAPI, JSON, and XML responses
  • keep session-header store behavior compatible with existing Thingifier API tests

Tests

  • mvn -pl ercoremodel,thingifier test

Copilot AI review requested due to automatic review settings July 28, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@eviltester
eviltester merged commit cb72a82 into master Jul 28, 2026
3 checks passed
@eviltester
eviltester deleted the codex/thingifier-api-spec-views branch July 28, 2026 15:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d3ab72563

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +86 to +87
if (route.isHiddenFromDocumentation() || route.isDisabled()) {
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve hidden verbs in OPTIONS Allow headers

When a route is hidden rather than disabled, it remains callable because ThingifierHttpApiRoutings skips only disabled definitions, but this condition removes the hidden verb while rebuilding the endpoint's Allow header. For example, hiding a POST route leaves POST registered while OPTIONS claims it is unavailable; only disabled routes should be excluded from the runtime header.

Useful? React with 👍 / 👎.

Comment on lines +530 to +533
final boolean visible =
requestSchema
? view.isRequestVisible(propertyName)
: view.isResponseVisible(propertyName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude disallowed fields from request schemas

When a view calls disallowInputFields("forbidden") without also hiding that field, this request-schema branch still includes it because it checks only request visibility. Runtime validation separately checks isInputAllowed and returns 422, so the generated OpenAPI schema tells clients they may submit a field the API always rejects; request view schemas need to account for both policies.

Useful? React with 👍 / 👎.

Comment on lines +343 to +349
for (EntityViewDefinition view : objectSchemaDefinition.getViews()) {
ObjectSchema viewObject = asResponseViewObjectSchema(view);
components.addSchemas(view.getName(), viewObject);

ObjectSchema createViewObject = asRequestViewObjectSchema(view);
createViewObject.title("create " + createViewObject.getTitle());
components.addSchemas("create_" + view.getName(), createViewObject);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Namespace view component schemas by entity

When two entities define the same view name—valid because EntityDefinition enforces uniqueness only within each entity—both views are inserted into the global OpenAPI components map under the same keys. The later entity overwrites the earlier schema, so routes for one entity can reference the other entity's request and response shapes; component names or references need an entity-specific namespace.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants