hapijs / hapijs/joi

Use same schema in backend and frontend

Open
#3,046 0 comments 3 reactions 0 assignees View on GitHub
support
Dominant language
JavaScript
Stars
21.2k
Forks
1.5k
Avg merge
4h 57m
Merged PRs (30d)
14

Description

### Runtime

node.js & browser

### Runtime version

Latest

### Module version

Latest

### Used with

_No response_

### Any other relevant information

_No response_

### How can we help?

For those who want to have only one schema for both backend and frontend, what is the correct conversion path? The same need is described in the thread below:
https://github.com/hapijs/joi/issues/2385#issuecomment-1922585161

I can use describe() in the Node.js part, but how do I compile it again in the browser? I tried using the compile() function, but it didn't work. The build() function is not included in the browser version.

Isn't this a valid use case?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.