Skip to content
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

(fix): handle allow-mulitple query parameter validation #3561

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dsinghvi
Copy link
Member

@dsinghvi dsinghvi commented May 7, 2024

Goal

allow-multiple query parameters should support list examples.

Approach

Validating examples in Fern is pretty complex. So the way I approached this was to validate the query param as a list and as a non-list. If there are no errors in one of the two cases, then fern check passes.

If there are errors, then we list them for the non-list case.

@dsinghvi dsinghvi marked this pull request as ready for review May 7, 2024 20:29
rawType = rawType.startsWith("optional")
? `optional<list<${rawType}>>`
: `list<${rawType}>`;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

tracking that this is weird

});

const expectedViolations: ValidationViolation[] = [];
expect(violations).toEqual(expectedViolations);
Copy link
Member Author

Choose a reason for hiding this comment

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

the goal was to get this test case to pass which works

"endpoints",
"get",
{
arrayIndex: 3,
Copy link
Member Author

Choose a reason for hiding this comment

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

lines 180-195 are incorrect, ideally the diff should be 0 here

@dsinghvi dsinghvi requested a review from amckinney May 7, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant