Skip to content

Keep nullable when the array rule follows nullable - #1326

Open
andreasisaak wants to merge 1 commit into
dedoc:mainfrom
andreasisaak:fix/keep-nullable-on-array-rule
Open

andreasisaak wants to merge 1 commit into
dedoc:mainfrom
andreasisaak:fix/keep-nullable-on-array-rule

Conversation

@andreasisaak

Copy link
Copy Markdown

Hi, and thanks for Scramble, it saves me a lot of work 👍

A field marked nullable and array loses null in the generated schema, so a client generated from it (openapi-typescript in my case) can't send null, although the API accepts it. The array mapper builds a new type and drops the nullable mark from the rule before it.

The other mappers keep that mark, so this change does the same. Two tests cover a plain field and a field inside a list item, and both fail without the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant