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 the issue with invalid example value generation for an array based query parameter #1465

Merged
merged 6 commits into from
Dec 26, 2024

Conversation

yogeshnikam671
Copy link
Member

What:
Currently when an example is generated for an endpoint where the query parameter is an array, following kind of query value is generated in the example file.

"query": {
            "queries": "[YRFBM, XURHT, DATUF, QYART, QTEKV]"
 }

This is an invalid format. This PR fixes this issue.

How:
The issue is fixed by properly serialising such array based query parameters and storing it in the example file in the correct format as follows.

"query":{
  "queries": ["YRFBM", "XURHT", "DATUF", "QYART", "QTEKV"]
}

Checklist:

Issue ID:
Closes: #1453

@yogeshnikam671 yogeshnikam671 force-pushed the json_array_query_example_gen_bug_fix branch from 38745cc to 354cb0f Compare December 6, 2024 09:21
Copy link
Member

@harikrishnan83 harikrishnan83 left a comment

Choose a reason for hiding this comment

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

Can we please add some tests to avoid any regression on this? something to make sure there is no accidental change back from asJsonMap to asMap

Samy and others added 5 commits December 18, 2024 14:32
* main: (122 commits)
  Updating OpenAPI ParseOptions to set isResolveRequestBody and isResolveResponses to true
  Updating version to 2.0.48
  Update v3-swagger-parser to 2.1.24
  2.0.47
  fixed the content overlapping in the code mirror error tooltip
  Bump up the version for release
  Changed Validate Examples button name to Save & Validate Also improved the unsaved changes popup message
  Updated the error message shown by the examples GUI for for an unsaved example
  2.0.45
  Example error tooltip should show at the bottom
  Example error messages should be highlighted in red
  Example has x issues should be highlighted in red
  Add extensible schema support in VS
  Make ExampleFromFile parse an invalid example so that later it would be caught in example validation. Keep the behavior of loading externalised examples the same for tests and stub
  fix type in detailsPre count fallback
  HEADER AND QUERY PARAM issue with GUI Rectified
  don't show count if count is 0 for errorCount
  modify dropdown grammar and visibility.
  increasing the font size and adding white background to make the tooltip error message easier to read
  Fix chevron down icon css.
  ...
@harikrishnan83 harikrishnan83 self-requested a review December 26, 2024 04:03
Copy link
Member

@harikrishnan83 harikrishnan83 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@harikrishnan83 harikrishnan83 merged commit d4906c7 into main Dec 26, 2024
2 checks passed
@harikrishnan83 harikrishnan83 deleted the json_array_query_example_gen_bug_fix branch December 26, 2024 04:04
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.

cli: invalid generation of json arrays
2 participants