Support generating required fields as not optional in TS.#1
Closed
Support generating required fields as not optional in TS.#1
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.
heymb
commented
Aug 2, 2024
| export interface IGetWidgetRequest { | ||
| /** The widget ID. */ | ||
| id?: number; | ||
| id: number; |
Owner
Author
There was a problem hiding this comment.
The changed properties in this file are now not optional since they are required in the FSD (search for "required" and compare).
heymb
commented
Aug 2, 2024
| export interface IGetWidgetRequest { | ||
| /** The widget ID. */ | ||
| id?: number; | ||
| id: number; |
Owner
Author
There was a problem hiding this comment.
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
Owner
Author
|
Closing since opened a new PR targeting origin instead of my fork: FacilityApi#69 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements minimum support for FacilityApi#34
Does not add other validation.
Builds upon this other PR which adds tests for existing behavior: FacilityApi#68