Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@heymb
Copy link
Contributor

@heymb heymb commented Aug 2, 2024

Add tests for current TS output of DTOs with "optional" or required fields (see "Required Fields" section, can't hyperlink).

Context: This issue mentions wanting support for required fields as a minimum. Recently, others mentioned wanting this behavior.

Follow up - Implementation: A follow up PR implements minimum support for required fields. It seemed better to break out adding tests for existing behavior into this PR that can be merged first and adding support can be merged after as a follow up PR.

@heymb heymb changed the title Add tests for current behavior of data properties (optional and required). Add tests for current TS output of DTOs with "optional" and required fields. Aug 2, 2024
@heymb heymb requested a review from ejball August 2, 2024 20:04
@heymb heymb merged commit 6cf4974 into FacilityApi:master Aug 5, 2024
heymb added a commit that referenced this pull request Aug 5, 2024
…n TS. (#69)

BREAKING CHANGE: Generate DTO required fields as NOT optional properties on interface in TS. Previously, all DTO fields (including required ones) were optional properties on an interface in TS.

- Implement minimum support for #34. Does not add other validation.
- Update test added in #68 since made change.
- Run codegen since FSD file has required fields.
- Update version and release notes. 

Learn more:
- FSD docs on "Required Fields": https://facilityapi.github.io/define/fsd#fields
- FSD docs on DTOs: https://facilityapi.github.io/define/fsd#data-transfer-objects
- TS docs on optional properties: https://www.typescriptlang.org/docs/handbook/2/objects.html#optional-properties

---------

Co-authored-by: Michael Baldwin <michael.baldwin@faithlife.com>
@heymb heymb deleted the addTestsForDataProperties branch August 6, 2024 01:09
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.