-
Notifications
You must be signed in to change notification settings - Fork 0
Support generating required fields as not optional in TS. #1
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
Conversation
Generates error sets in TypeScript. --------- Co-authored-by: Michael Baldwin <[email protected]>
Preparing to add fastify server impl.
Codegen is incoming!
And generate conformance plugin.
- all but three conformance tests are passing (mirrorBytes, mirrorText, and bodyTypes) which will require a bit of work to configurare the fastify server, as well as potential changes to the generated client, which assumes that fetch requests come back with JSON.
- This allows the plugin to live anywhere without needing to know where the client type file is. I debated creating a new type file instead of inlining them in the plugin, but didn't really see a point since it is just for the server to use. Perhaps I'm missing something though...
No longer needed!
- This allows the plugin to live wherever the user wants it to live. - Ideally I would think the express server should be generated the same way but that would be a breaking change, so maybe not needed?
As well, we are now running all conformance tests together, testing all client and server code.
https://fastify.dev/docs/latest/Reference/Validation-and-Serialization/#serialization I opted to only handle response schemas since (from my understanding) that is where most of the performance gain is at using `fast-json-stringify`. The request schemas are mostly for validation, which Facility can already take care of for us.
instead of digging into the type name directly.
Instead we just set it to a suggestion in `.editorconfig`
Add JsonSchema support to fastify plugin.
Allows appending a custom suffix to generated file names before the extension. For example, if the suffix is `.g`, the generated client file name would be `moduleName.g.js` (or `moduleName.g.ts` when using TypeScript).
* Publish 2.10.0. * Update release notes.
@@ -88,7 +88,7 @@ export interface ICreateWidgetResponse { | |||
/** Request for GetWidget. */ | |||
export interface IGetWidgetRequest { | |||
/** The widget ID. */ | |||
id?: number; | |||
id: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changed properties in this file are now not optional since they are required in the FSD (search for "required" and compare).
@@ -905,7 +905,7 @@ export interface ICreateWidgetResponse { | |||
/** Request for GetWidget. */ | |||
export interface IGetWidgetRequest { | |||
/** The widget ID. */ | |||
id?: number; | |||
id: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as this comment if based on same FSD file which it seems to be.
ae8dc35
to
ff4f6ea
Compare
…enerating required fields as not optional is a breaking change
Closing since opened a new PR targeting origin instead of my fork: FacilityApi#69 |
Implements minimum support for FacilityApi#34
Does not add other validation.
Builds upon this other PR which adds tests for existing behavior: FacilityApi#68