Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't default to addtional properties in schemas #952

Merged

Conversation

shakyShane
Copy link
Collaborator

@shakyShane shakyShane commented Apr 10, 2024

https://app.asana.com/0/1201614831475344/1207053312757015/f

TL;DR

This PR restricts additional properties in the build-types script.

What changed?

The createTypesForSchemaFile and createTypesForSchemaMessages functions in build-types.mjs now include the additionalProperties: false option.

Why make this change?

The library that generates the types makes open-ended objects by default by adding the index signature.

without this change, it's really tedious to create schemas since every top-level and nested object requires you to put "additonalProperties": false


@shakyShane
Copy link
Collaborator Author

shakyShane commented Apr 10, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @shakyShane and the rest of your teammates on Graphite Graphite

@shakyShane shakyShane marked this pull request as ready for review April 10, 2024 14:58
@shakyShane
Copy link
Collaborator Author

@jonathanKingston just a QOL thing, I noticed whilst trying to add types for PIR that this was a pain.

@shakyShane shakyShane merged commit 3f528b9 into main Apr 11, 2024
4 checks passed
@shakyShane shakyShane deleted the 04-10-don_t_default_to_addtional_properties_in_schemas branch April 11, 2024 08:36
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.

None yet

2 participants