Skip to content

docs: correct Management API spec response schemas and rename spec file#604

Open
d-klotz wants to merge 2 commits into
nextfrom
claude/suspicious-thompson-64eba0
Open

docs: correct Management API spec response schemas and rename spec file#604
d-klotz wants to merge 2 commits into
nextfrom
claude/suspicious-thompson-64eba0

Conversation

@d-klotz

@d-klotz d-klotz commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Renames "Frigg Management API.yml"frigg-management-api.yml (spaces in filename broke unquoted shell/editor paths)
  • Updates all 40 {% swagger %} embeds in docs/reference/api-reference.md to reference the new filename
  • Corrects response schemas throughout the spec:
    • Entity schema now matches the Prisma model (id, userId, credentialId, name, moduleName, externalId, data, createdAt, updatedAt)
    • AuthCallbackResult (POST /api/authorize response) uses concrete example values ("7", "12", "hubspot") — no more {{generatedCredentialId}} placeholders in response bodies
    • Options response schema correctly typed as { options: array }
    • AuthorizationRequirements schema covers both OAuth ({ type: "oauth2", url: "..." }) and API-key ({ type: "apiKey", jsonSchema: {...} }) flows
  • Fixes management-api.md reference: authorize callback response field entityTypetype (matches process-authorization-callback.js line 142)

Test plan

  • Import docs/.gitbook/assets/frigg-management-api.yml into Postman — no validation errors
  • GitBook preview renders all 20 swagger embeds without broken asset links
  • POST /api/authorize response example shows { "credential_id": "12", "entity_id": "7", "type": "hubspot" } (no {{...}} placeholders)
  • Entity schema reflects Prisma model fields

🤖 Generated with Claude Code

📦 Published PR as canary version: 2.0.0--canary.604.ba86ee6.0

✨ Test out this PR locally via:

npm install @friggframework/core@2.0.0--canary.604.ba86ee6.0
npm install @friggframework/devtools@2.0.0--canary.604.ba86ee6.0
npm install @friggframework/eslint-config@2.0.0--canary.604.ba86ee6.0
npm install @friggframework/prettier-config@2.0.0--canary.604.ba86ee6.0
npm install @friggframework/schemas@2.0.0--canary.604.ba86ee6.0
npm install @friggframework/serverless-plugin@2.0.0--canary.604.ba86ee6.0
npm install @friggframework/test@2.0.0--canary.604.ba86ee6.0
npm install @friggframework/ui@2.0.0--canary.604.ba86ee6.0
# or 
yarn add @friggframework/core@2.0.0--canary.604.ba86ee6.0
yarn add @friggframework/devtools@2.0.0--canary.604.ba86ee6.0
yarn add @friggframework/eslint-config@2.0.0--canary.604.ba86ee6.0
yarn add @friggframework/prettier-config@2.0.0--canary.604.ba86ee6.0
yarn add @friggframework/schemas@2.0.0--canary.604.ba86ee6.0
yarn add @friggframework/serverless-plugin@2.0.0--canary.604.ba86ee6.0
yarn add @friggframework/test@2.0.0--canary.604.ba86ee6.0
yarn add @friggframework/ui@2.0.0--canary.604.ba86ee6.0

d-klotz and others added 2 commits June 8, 2026 19:10
Rename `Frigg Management API.yml` -> `frigg-management-api.yml`. The spaces
broke unquoted shell paths, tripped some editors, and required URL/`<>`
escaping in links. Updated all 40 references (20 swagger `src` + 20 link
targets) in api-reference.md.

No spec content change; Redocly still valid; embeds remain 1:1 with the spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to PR #602. The response schemas/examples were partly inherited from
the original GitBook spec and partly loose guesses; align them to the actual
router code and the Entity Prisma model:

- Entity: model the real persisted shape (id, userId, credentialId, name,
  moduleName, externalId, data, timestamps) instead of the guessed {id,user,name}
- AuthCallbackResult: { credential_id, entity_id, type } with concrete example
  values (were {{generated...}} placeholders that leaked into a response body)
- AuthorizationRequirements / Options: align to observed shapes (oauth `url`
  vs apiKey `jsonSchema`; `options` arrays) instead of asserting jsonSchema/uiSchema
- Replace remaining {{...}} placeholders in request/response examples with
  concrete values; keep {{var}} only on reusable path/header parameters
- Reference (skills/frigg/.../management-api.md): POST /api/authorize returns
  `type`, not `entityType` (matches process-authorization-callback.js)

Re-validated: Redocly valid; 16 paths / 20 operations; all $refs resolve.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@d-klotz d-klotz added the release Create a release when this pr is merged label Jun 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@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: ba86ee676d

ℹ️ 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 +821 to +827
jsonSchema:
type: object
additionalProperties: true
description: JSON Schema describing the credential form (API-key modules).
uiSchema:
type: object
additionalProperties: true

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 Document nested form requirements

For API-key/form auth modules, the management route returns the module's authorization requirements verbatim (integration-router.js calls module.getAuthorizationRequirements()), and the existing CLI/form consumers read the schema from authReqs.data.jsonSchema/authReqs.data.uiSchema (see packages/devtools/frigg-cli/auth-command/api-key-flow.js). Moving these fields to top-level here will make generated docs/clients tell users to read response.jsonSchema, which is undefined for those modules, so form-based authorization flows will not render correctly.

Useful? React with 👍 / 👎.

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

Labels

release Create a release when this pr is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant