docs(api-reference): type nullable org scalar fields as string/number - #255
Conversation
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.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
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.stripeLookupKeyfromobject→stringwithnullable: true. - Fix invitation DTO
namefields fromobject→stringwithnullable: true. - Fix budget DTO
maxTransactionsfields fromobject→numberwithnullable: true.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
eruizgar91
left a comment
There was a problem hiding this comment.
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, sonullable: trueis the right spelling (not 3.1'stype: ["string","null"]). stripeLookupKeybeing bothrequiredandnullableis legal in 3.0 (key must be present, value may be null).maxTransactionsis not in either DTO'srequiredlist, so addingnullable: trueis 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, andnumbergeneratesfloat/doublein most codegens. That said, this spec usesnumber57 times andintegerzero 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.
Follow-up to #254 addressing the review points eruizgar91 raised on nvm-monorepo#2532.
Five fields in the Organizations OpenAPI spec rendered as
type: objectinstead of their scalar type — the same SWC decorator-metadata gotcha onT | nullDTO fields (a field with no explicit@ApiProperty({ type })emitsdesign:type = Object). Fixed in the source in nvm-monorepo#2532; this mirrors it in the committed spec:TierCatalogRowDto.stripeLookupKeyobjectstring, nullableInvitationResponseDto.nameobjectstring, nullablePublicInvitationInfoDto.nameobjectstring, nullableCreateGroupBudgetDto.maxTransactionsobjectnumber, nullableUpdateGroupBudgetDto.maxTransactionsobjectnumber, nullableTargeted field-level change — every other schema, path and description is untouched; all
$refs resolve.Test plan
$refs resolve; 5 fields now carry correct scalar types + nullability