-
Notifications
You must be signed in to change notification settings - Fork 268
feat(cli): add isWildcardStatusCode field to IR for 4XX/5XX support #10746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devin-ai-integration
wants to merge
16
commits into
main
Choose a base branch
from
devin/1763657657-cli-fdr-wildcard-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(cli): add isWildcardStatusCode field to IR for 4XX/5XX support #10746
devin-ai-integration
wants to merge
16
commits into
main
from
devin/1763657657-cli-fdr-wildcard-support
+1,231
−97
Conversation
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
…to FDR - Add isWildcardStatusCode field to IR schema (errors.yml and http.yml) - Update IR SDK TypeScript interfaces and serialization - Update OpenAPI parser to detect 4XX/5XX wildcards and set isWildcardStatusCode=true - Update IR-to-FDR converter to pass isWildcardStatusCode as isWildcard to FDR - Update test snapshots with new isWildcard field Co-Authored-By: [email protected] <[email protected]>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…57657-cli-fdr-wildcard-support
… and update FDR converter Co-Authored-By: [email protected] <[email protected]>
…it-manager.devin.ai/proxy/github.com/fern-api/fern into devin/1763657657-cli-fdr-wildcard-support
9 tasks
…s codes Co-Authored-By: [email protected] <[email protected]>
…defined fields Co-Authored-By: [email protected] <[email protected]>
…rom IR generators The IR SDK serializer automatically includes optional fields in the serialized output when they are defined on the TypeScript interface (structural typing). Explicitly setting isWildcardStatusCode to undefined was redundant and could cause serialization inconsistencies between undefined and null in different contexts. This change removes the explicit undefined assignments and lets the IR SDK handle the field serialization, which correctly includes 'isWildcardStatusCode: undefined' for non-wildcard status codes in the IR snapshots. Co-Authored-By: [email protected] <[email protected]>
…ructural typing TypeScript's structural typing requires the isWildcardStatusCode property to exist on ErrorDeclaration and HttpResponse objects because the IR SDK defines it as 'isWildcardStatusCode: boolean | undefined' (not optional). This is different from an optional property 'isWildcardStatusCode?: boolean'. The IR SDK serializer includes the field in the output even when undefined, which is the expected behavior for the snapshots. This fixes the TypeScript compilation errors in CI. Co-Authored-By: [email protected] <[email protected]>
…comments The IR SDK generator adds JSDoc comments from the YAML schema docs to the generated TypeScript types. This commit regenerates the IR SDK to include the documentation comments for the isWildcardStatusCode field that were added to the YAML schema in a previous commit. This fixes the 'run' CI check which verifies that generated code matches the committed code by running 'git diff --exit-code' after generation. Co-Authored-By: [email protected] <[email protected]>
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.
Description
Linear ticket: Refs https://buildwithfern.slack.com/archives/C09NULAN2H3/p1763394573684379
This PR adds support for wildcard status codes (4XX and 5XX) in the IR schema and passes this information through to the FDR SDK. This is part of a larger effort to properly represent and display wildcard status codes in the OpenAPI parser and frontend.
Context: When parsing OpenAPI specs with 4XX or 5XX response codes, we were converting them to base values (400/500) but losing the information that they represent wildcards. This PR adds an
isWildcardStatusCodefield to track this information through the IR.Changes Made
isWildcardStatusCode: optional<boolean>field toHttpResponseandErrorDeclarationtypes in IR schema/^[45]XX$/iand set the flag appropriatelyisWildcardfield to FDR SDK (set totruefor wildcards,undefinedfor non-wildcards)isWildcardStatusCode: undefinedfor non-wildcard responsesTesting
Note: The gRPC test was skipped locally due to missing buf/protoc-gen-openapi dependencies (requires Go). The gRPC IR snapshot was updated manually based on the expected output format.
Important Review Points
TypeScript Type Handling: The FDR converter uses
isWildcard: condition === true ? true : undefinedinstead of conditional spread operators. This is because FDR SDK types defineisWildcard: boolean | undefined(required property that can be undefined) notisWildcard?: boolean(optional property). The property must exist on the object.Wildcard Detection: The regex
/^[45]XX$/idetects 4XX and 5XX patterns (case-insensitive). When detected, the status code is set to the base value (400 for 4XX, 500 for 5XX) andisWildcardStatusCodeis set totrue.Manual Snapshot Updates: The gRPC IR snapshot (
grpc-comments-ir.snap) was updated manually because the test requires Go tooling that isn't installed on the VM. Please verify these changes are correct.Backward Compatibility: All non-wildcard responses now include
isWildcardStatusCode: undefined. This should be backward compatible since the field is optional in the schema.Requested by: [email protected] ([email protected])
Session: https://app.devin.ai/sessions/a0f73c8e74ac4d37858f2c845136bbe8