Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Validating JSON encoded values #660

Answered by mpvl
khepin asked this question in Q&A
Jan 22, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote
import "encoding/json"

field1: json.Valid // is Valid JSON

field2: json.Validate(#Schema). // field must be valid JSON and conform to a given CUE schema

#Schema: { ... }

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@khepin
Comment options

Answer selected by khepin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants