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.

Requiredness of body parameter lost

See original GitHub issue

Input

{
  "name": "indexer",
  "in": "body",
  "required": true,
  "schema": {
    "$ref": "#/definitions/Indexer"
  },
  "description": "The definition of the indexer to create or update."
}

Output

"requestBody": {
  "content": {
    "application/json": {
      "description": "The definition of the indexer to create or update.",
      "schema": {
        "$ref": "#/components/schemas/Indexer"
      }
    }
  }
}

Expected

"requestBody": {
  "content": {
    "application/json": {
      "description": "The definition of the indexer to create or update.",
      "schema": {
        "$ref": "#/components/schemas/Indexer"
      }
    }
  },
  "required": true
}

Detail

According to https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md#request-body-object, required defaults to false, so it needs to be set to true explicitly 🙂

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MikeRalphsoncommented, Jun 7, 2017

I’m consuming the npm package.

v2.2.1 just published.

1reaction
MikeRalphsoncommented, Jun 7, 2017

whoops, saw your comment only now, but didn’t take much time to fix (in case the fix is okay, haven’t spent too much time following the code) 🙂 awesome project!

No, @olydis that’s cool - the fix is correct and helped me decide which branch to apply it to. (Let me know if you’re using the npm package and/or the web front-end and I will do a proper release).

Have applied a similar fix for 2.0 in: file parameters.

Thanks again for spotting the issue, and for the PR and kind comments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom connector request body parameter lost
Hello, In my application I want to use Azure functions from Power Apps via a custom connector. All of my requests to Azure...
Read more >
Spring post method "Required request body is missing"
My issue was that, when I was making requests from Postman, the "Content-Length" header was unchecked, so service was not considering the ...
Read more >
Missing body parameters in OpenAPI v2 document · Issue #467
Hi, We experience the issue with generating OpenAPI v2 (Swagger) documents which have multiple entries (media types) in the request body's ...
Read more >
How to properly handle missing parameters in @HttpPost ...
Is there any sufficient and maintainable approach of handling missing parameters passed to POST methods in request body ? Here is my code:...
Read more >
Request Validation | Prism - Stoplight
Requests which expect a request body, query parameter, or a path parameter, will be validated. For example, make a POST with a JSON...
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