Skip to content

Add valibot schemas for trail type - #14542

Closed
marjisound wants to merge 2 commits into
mainfrom
add-valibot-schema-for-trail-type
Closed

marjisound wants to merge 2 commits into
mainfrom
add-valibot-schema-for-trail-type

Conversation

@marjisound

@marjisound marjisound commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Sep 22, 2025

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 22, 2025

Copy link
Copy Markdown

@marjisound

Copy link
Copy Markdown
Contributor Author

Look at this ticket for more info #14548

@marjisound marjisound removed this from the Decommission AR milestone Sep 23, 2025
@github-actions

Copy link
Copy Markdown

"This PR is stale because it has been open 30 days with no activity. Unless a comment is added or the “stale” label removed, this will be closed in 3 days"

@github-actions github-actions Bot added the Stale label Oct 24, 2025
@github-actions

Copy link
Copy Markdown

This PR was closed because it has been stalled for 3 days with no activity.

@github-actions github-actions Bot closed this Oct 27, 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