Skip to content

docs(api-reference): type nullable org scalar fields as string/number - #255

Merged
aaitor merged 1 commit into
mainfrom
docs/org-spec-nullable-scalar-fields
Jul 29, 2026
Merged

docs(api-reference): type nullable org scalar fields as string/number#255
aaitor merged 1 commit into
mainfrom
docs/org-spec-nullable-scalar-fields

Conversation

@aaitor

@aaitor aaitor commented Jul 28, 2026

Copy link
Copy Markdown
Member

Follow-up to #254 addressing the review points eruizgar91 raised on nvm-monorepo#2532.

Five fields in the Organizations OpenAPI spec rendered as type: object instead of their scalar type — the same SWC decorator-metadata gotcha on T | null DTO fields (a field with no explicit @ApiProperty({ type }) emits design:type = Object). Fixed in the source in nvm-monorepo#2532; this mirrors it in the committed spec:

Field Was Now
TierCatalogRowDto.stripeLookupKey object string, nullable
InvitationResponseDto.name object string, nullable
PublicInvitationInfoDto.name object string, nullable
CreateGroupBudgetDto.maxTransactions object number, nullable
UpdateGroupBudgetDto.maxTransactions object number, nullable

Targeted field-level change — every other schema, path and description is untouched; all $refs resolve.

Test plan

  • All $refs resolve; 5 fields now carry correct scalar types + nullability
  • Mintlify validation

Follow-up to #254. Five fields in the Organizations OpenAPI spec rendered
as `type: object` instead of their scalar type — the SWC decorator-metadata
gotcha on `T | null` DTO fields, fixed in the source in nvm-monorepo #2532:

- TierCatalogRowDto.stripeLookupKey -> string, nullable
- InvitationResponseDto.name + PublicInvitationInfoDto.name -> string, nullable
- Create/UpdateGroupBudgetDto.maxTransactions -> number, nullable

Codegen/SDK consumers now get the correct scalar types.
Copilot AI review requested due to automatic review settings July 28, 2026 16:08
@aaitor
aaitor requested a review from a team as a code owner July 28, 2026 16:08
@mintlify

mintlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Nevermined 🟢 Ready View Preview Jul 28, 2026, 4:09 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Organizations OpenAPI spec in docs/api-reference/organizations-openapi.json to correctly represent several nullable scalar fields that were previously emitted as type: object, improving the rendered API reference and downstream tooling (e.g., SDK/codegen) fidelity.

Changes:

  • Fix TierCatalogRowDto.stripeLookupKey from objectstring with nullable: true.
  • Fix invitation DTO name fields from objectstring with nullable: true.
  • Fix budget DTO maxTransactions fields from objectnumber with nullable: true.

@mintlify

mintlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Nevermined 🟡 Building Jul 28, 2026, 4:08 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@eruizgar91 eruizgar91 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving — the change is correct and low-risk. Notes below are follow-ups, nothing blocking.

Verified

  • JSON parses; all 84 $refs resolve.
  • Spec is openapi: 3.0.0, so nullable: true is the right spelling (not 3.1's type: ["string","null"]).
  • stripeLookupKey being both required and nullable is legal in 3.0 (key must be present, value may be null).
  • maxTransactions is not in either DTO's required list, so adding nullable: true is correct and consistent with the other four fields.

Follow-up: same bug in 5 more fields

Five other properties in this file carry the identical SWC signature (type: object on a nullable scalar). Four of them have a string example, so the spec contradicts itself today:

Schema Field Should be
OrganizationMemberWithProfileDto name — example "John Doe" string, nullable
OrganizationMemberWithProfileDto stripeAccountId — example "acct_1234567890" string, nullable
CustomerResponseDto userName — example "Aitor Argomaniz" string, nullable
CustomerResponseDto userEmail — example "aitor@example.com" string, nullable (format: email)
OrganizationActivityEventResponseDto actorUserId — "…or null for system events" string, nullable

Same root cause, same one-line @ApiProperty({ type: String }) fix at source. Since each round-trip costs a source PR plus a mirror PR here, folding these into nvm-monorepo#2532 is cheaper than a #256. (branding, live, sandbox, subject and metadata are genuine objects — leave them as-is.)

Nits

  • maxTransactions: number — a transaction count is an integer, and number generates float/double in most codegens. That said, this spec uses number 57 times and integer zero times, so it matches the existing convention. Only worth changing alongside a source-side annotation.
  • The "Mintlify validation" checkbox is still unchecked; the spec is wired into docs.json, so the preview build is the real check.

One thing to watch

This repo's copy is hand-mirrored (no workflow here syncs organizations-openapi.json), so if nvm-monorepo#2532 doesn't land, the next spec regeneration silently reverts this. Just make sure the source PR merges.

@aaitor
aaitor merged commit e570012 into main Jul 29, 2026
4 checks passed
@aaitor
aaitor deleted the docs/org-spec-nullable-scalar-fields branch July 29, 2026 09:00
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.

3 participants