question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] When running extractor for OAS version 3 Json it is converting boolean values to string

See original GitHub issue

Release version

4.0.3

Describe the bug

When running extractor pipeline with option OAS v3 json, specification.json generated will convert the boolean values to string which causing linting failed.

Expected behavior

boolean values should not converted to string.

example: expected result “required” : true

generated specification result: “required” : “true”

Actual behavior

generated specification result: “required” : “true” `“delete”: { “tags”: [ “OptIn” ], “summary”: “Delete Opt-In”, “description”: “Delete Opt-In status for a user. Resets them to not opted in.”, “operationId”: “delete-users-userid”, “parameters”: [ { “name”: “userId”, “in”: “path”, **

“required”: “true”,

** “schema”: { “type”: “string” } } ], “responses”: { “200”: { “description”: “Deleted Opt-In Data”, “content”: { “application/json”: { “schema”: { “$ref”: “#/components/schemas/OptInData” }, “example”: { “userId”: “string” } } } },`

Reproduction Steps

Run extractor pipeline with the generator option OpenAPIV3Json and analyse the specification.json.

83:11 error path-params Path parameter "userId" must have "required" property that is set to "true". paths./AccountLinks/{userId}/accounts/{accountNumber}.get.parameters[0] 87:25 error oas3-schema "required" property must be equal to one of the allowed values. paths./AccountLinks/{userId}/accounts/{accountNumber}.get.parameters[0].required 87:25 error oas3-schema "required" property type must be boolean. paths./AccountLinks/{userId}/accounts/{accountNumber}.get.parameters[0].required

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mihirsurtingcommented, Mar 7, 2023

@guythetechie , I have edited in the comment with the json.

0reactions
guythetechiecommented, Mar 9, 2023

Fix pushed in latest release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schema validation for null values with OpenAPI (swagger) ...
I couldn't find an OpenAPI schema to JSON schema converter for .NET. I'm trying to figure out if there is an easy solution...
Read more >
[BUG] Error processing OpenAPI json file for python client
Is there a quick way to test your fix with openapi-generator-cli? I tried to openapi-generator-cli version-manager set 6.0.0 which installed the ...
Read more >
Using JQ to extract data from OpenAPI files
Ever wanted to quickly find, extract or modify data coming from some JSON documents on the command line? JQ is the tool you're...
Read more >
property 'required' of response header in OAS 3 yaml files ...
I am using directus (headless cms) which outputs an openapi spec that NSwag/JsonConvert is unable to use. Newtonsoft.Json.
Read more >
Common Mistakes Developers Make In Their OpenAPI 3 ...
Using the old “ swagger” property to specify OpenAPI version​​ This is invalid as OAS 3 has now replaced that with the new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found