Skip to content

Conversation

marjisound
Copy link
Contributor

@marjisound marjisound commented Sep 22, 2025

What does this change?

This PR is introducing valibot for the FETrailType. The advantage of using valibot is that we can validate the FETrailType json responses in the client. Currently the client side calls to get the list of trails are not doing any validation.

The cncern of doing this, is that we have to replace all the types within FETrailType into their alternative valibot schemas. Then we can use them as typescript types by using the valibot Output type. e.g. type FETrailType = Output<typeof FETrailTypeSchema>;.

This means, the FEFormat also needs to be converted into a valibot schema. But because FEFormat is used in all of the article and front data models that are processed server side, we had to run gen-schemas to generate new json schemas. The generated schemas seems to have lost their named types for the new valibot types, which is not idea.

The TypeScript JSON Schema generator (typescript-json-schema) is now inlining the entire type definition instead of creating a reference to a named type.

We are going to look into how to fix this.

Copy link

github-actions bot commented Sep 22, 2025

Copy link

github-actions bot commented Sep 22, 2025

@marjisound
Copy link
Contributor Author

Look at this ticket for more info #14548

@marjisound marjisound removed this from the Decommission AR milestone Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant