fix: adding type:string to const discriminators#139
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR fixes an OpenAPI generator issue by adding explicit Key Changes:
Context: Impact: Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/UsAccountInfo.yaml | added explicit type: string to accountType const field for OpenAPI generator compatibility |
| openapi/components/schemas/common/PixAccountInfo.yaml | added explicit type: string to accountType const field for OpenAPI generator compatibility |
| openapi/components/schemas/external_accounts/UsAccountExternalAccountInfo.yaml | added explicit type: string to accountType const field for OpenAPI generator compatibility |
| openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml | added explicit type: string to accountType const field for OpenAPI generator compatibility |
| openapi.yaml | bundled schema with type: string added to all accountType const discriminators |
| mintlify/openapi.yaml | bundled schema copy with type: string added to all accountType const discriminators |
Sequence Diagram
sequenceDiagram
participant Client as API Client
participant Generator as OpenAPI Generator
participant Schema as OpenAPI Schema
participant Validator as Field Validator
Note over Client,Validator: Schema Generation Process
Client->>Generator: Request to generate SDK code
Generator->>Schema: Parse schema with discriminator
alt Before Fix (without type: string)
Schema-->>Generator: accountType: { const: "US_ACCOUNT" }
Generator->>Validator: Check if validator needed
Validator-->>Generator: ❌ No type specified, skip validator
Generator-->>Client: Generated code missing field validator
end
alt After Fix (with type: string)
Schema-->>Generator: accountType: { type: string, const: "US_ACCOUNT" }
Generator->>Validator: Check if validator needed
Validator-->>Generator: ✓ Type specified, create validator
Generator-->>Client: Generated code with proper field validator
end
Note over Client,Validator: Runtime Validation
Client->>Validator: Validate accountType discriminator field
Validator->>Validator: Check type is string
Validator->>Validator: Check value matches const
Validator-->>Client: ✓ Valid account type
shreyav
approved these changes
Jan 27, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TL;DR
Added explicit
type: stringproperty to allaccountTypefields in the OpenAPI schema. This fixes an issue where openapi generator didn't create the field validator for the discriminator.What changed?
Added the
type: stringproperty to allaccountTypefields across various account information schemas in the OpenAPI specification. This change affects multiple account types including:The change ensures that all
accountTypefields are properly typed as strings in the schema.