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.

[openapi-default-setter] Populate defaults in request body

See original GitHub issue

Breaking out into a separate issue from https://github.com/kogosoftwarellc/open-api/pull/398#issuecomment-478292795

The openapi-default-setter package does not support setting defaults in the request body. Ajv (which is used by openapi-request-validator) has a useDefaults option, but it sounds like adding support for setting body defaults in the openapi-default-setter package is preferred.

Thoughts on where to begin or prior art to take inspiration from?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jsdevelcommented, Apr 1, 2019

i’m OK changing the options we pass to the contructor/methods, i’m just not ok coupling the interfaces herein with ajv directly wherever possible

0reactions
jsdevelcommented, Apr 1, 2019

were you saying do a PR in this project to set useDefaults on the Ajv constructor?

yes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Describing Request Body - Swagger
Request bodies are typically used with “create” and “update” operations (POST, ... OpenAPI 3.0 provides the requestBody keyword to describe request bodies.
Read more >
open-api/index.ts at master - GitHub
A Monorepo of various packages to power OpenAPI in node - open-api/index.ts at master · kogosoftwarellc/open-api.
Read more >
handle Null and Default values in @RequestBody with Jackson
Your DTO will be populated by Jackson with the fields your JSON contains. The other fields will simply be null; that is the...
Read more >
express-openapi - npm
Leverages openapi parameter lists for parameter defaults, type coercion, and validation. See openapi-default-setter; See openapi-request- ...
Read more >
How not to make a framework for default request values in ...
How to make dynamic Spring default values for composite objects input into a REST ... Request body collection into a custom object
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