name = Schema Object Validation
description = Collection-local schema declarations for object payload validation.
scalar ARTICLE_SLUG = string & len(3..64) & pattern(/^[a-z0-9-]+$/)
scalar ARTICLE_TITLE = string & len(1..200)
scalar ARTICLE_SUBTITLE = string & len(1..200)
scalar AUTHOR_NAME = string & len(1..120)
schema Author {
id: UUID
name: AUTHOR_NAME
email: EMAIL
avatar: URI
}
schema Article {
slug: ARTICLE_SLUG
title: ARTICLE_TITLE
subtitle?: ARTICLE_SUBTITLE
image: URI
author: Author
content: string
dateCreated: DATE_TIME
}
---
Validate article payload
GET https://lorem-api.com/api/article/foo
? format = json
# Response matches the Article schema
^ & body === Article