DEV Community

Discussion on: Do you use Swagger, or document your API?

Collapse
patarapolw profile image
Pacharapol Withayasakpunt Author

JSON validation means that the server will not accept any wrong JSON schema.

Also, I have to make sure my database, especially if it is NoSQL, will not break with bad data.

Never trust user inputs.

Collapse
artoodeeto profile image
aRtoo

if its a public API you can use ajv I guess. But if it's within a team OpenAPI will do because the team will have to create the payload from frontend to backend.