Skip to content

Conversation

@mnahkies
Copy link
Owner

@mnahkies mnahkies commented Apr 1, 2023

Previously if an object property was a $ref then it would always be output as type T rather than T | undefined if it was not required.

@mnahkies mnahkies changed the title Mn/fix/support optional ref properties fix: respect optional $ref properties Apr 1, 2023

return [
`"${name}"`,
isRequired ? "" : "?",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix, the rest is just cleaning up the raw output a bit to make the unit test snapshot look nicer

@mnahkies mnahkies merged commit 32e80d8 into master Apr 1, 2023
@mnahkies mnahkies deleted the mn/fix/support-optional-ref-properties branch April 1, 2023 15:40
mnahkies added a commit that referenced this pull request Apr 1, 2023
- ditch the middleware, it made types more complicated
- use infer to typecheck that the parsed value matches
  the type we expected

this led me to discover and fix these issues:
- #22
- #23
- #24
mnahkies added a commit that referenced this pull request Apr 2, 2023
- ditch the middleware, it made types more complicated / less accurate
- use infer to typecheck that the parsed value matches the type we
expected

this led me to discover and fix these issues:
- #22
- #23
- #24
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.

2 participants