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.

Unexpected behavior for use_default

See original GitHub issue

On 0.6.0, I’m trying to use the new use_default_value_for_required_field argument.

Expectation:

All fields will have a default value, no matter if they’re required or not.

Actual:

image Not all fields have a default.

I’m wondering if this was meant to be an or: https://github.com/koxudaxi/datamodel-code-generator/blob/dbd146a26e0000d2670bc0a79fa6d73b1b5d490d/datamodel_code_generator/parser/jsonschema.py#L400

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
koxudaxicommented, Oct 27, 2020

@JosXa I’m sorry too late. I guess you are right. 👍 I will fix it. Thank you.

0reactions
koxudaxicommented, Nov 5, 2020

@JosXa I have released a new version as 0.6.2 This release includes two changes.

  1. change attribute name. use_default_on_required_field to apply_default_values_for_required_fields
  2. add --force-optional to enable force_optional_for_required_fields
Read more comments on GitHub >

github_iconTop Results From Across the Web

react-use/useDefault.md at master - GitHub
React state hook that returns the default value when state is null or undefined. Usage. import {useDefault} from 'react-use' ...
Read more >
Unexpected behaviour when applying a list of lambda ...
What's happening is that your lambdas are being bound to the loop variable k rather than the value associated with it, that's all...
Read more >
Error Handling - Talkdesk Studio
Each Studio component has a default, prebuilt behavior, responsible for handling the call in a predefined way in case an unexpected error occurs....
Read more >
DragSelectingTool influence on PanningTool - GoJS - Northwoods ...
I have tried to use default DragSelectingTool , but it yields the same behavior. PanningTool has no modifications except for canStart where I...
Read more >
Unexpected behaviour with Atlaskit Tabs
I upgraded Atlaskit Tabs to the latest 8.0.8 version (previously on 4.0.0) and notice some strange behavior. In my case, I have a...
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