Closed JasCodes closed 1 year ago
This is correct behavior, because the nullable field is not set. Therefore required must be.
@Carapacik Mate, you might be not correct here, as per openapi standards
If both nullable and required are not specified in the schema, it means that:
Required: The field is not required by default. This means that when a request is made, the field does not necessarily have to be present in the request body.
Nullable: The field is not nullable by default. This means that the field, if provided, should not be null.
During network call if the key is marked required it should be always present, but if key is nullable that means key can be still present with null value
"name": {
"type": "string",
"nullable": true
}
then
Then, it is acceptable to have "name": null
in your API request.
That is, you propose to make the required false and nullable true by default?
yes. in effect Mate, a field can be nullable and required at the same time, so its subtle. But as per openapi standard, during request key can be not passed and server should handle that unless its marked required. In that case error should be thrown.
I'll think about it in the next few days.
All all gereated fields should be optional not required
Schema components->schema
Generated Code