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.

Propose add required to schema constructor

See original GitHub issue

For a put request model require of id field, but for post request id not needed. For disabling in a post request I use dump_only=["id"], but I have not found such a way to do id required. For this reason, I suggest adding required to the schema constructor.

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
sloriacommented, Jul 4, 2019

Your use case can be achieved by using a separate schema for POSTs vs PUTs.

2reactions
lafrechcommented, Jul 10, 2019

In my APIs, I use the same schema but the ID for the PUT is in the URL, so it is injected in the view func (by webargs) as a path parameter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make all fields required in Mongoose - node.js - Stack Overflow
Probably the cleanest way to do this is by wrapping mongoose. Schema with a decorator and building this constructor yourself.
Read more >
Extending Schemas — marshmallow 3.19.0 documentation
You can specify a custom error-handling function for a Schema by overriding the handle_error method. The method receives the ValidationError and the original ......
Read more >
Schema Builder Text Area Issues - Salesforce Developers
I got the Solution for this. User-added image. You have to update the object name field from properties to Propety only,. Good Luck....
Read more >
Proposal for restricting property names - Google Groups
In the second JSON Schema draft, the only way to place a restriction on the name of a property is if the name...
Read more >
Model | LoopBack Documentation
The @model decorator can take jsonSchema to customize the JSON schema inferred for ... we require the use of the @property.array decorator, which...
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