Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Last active June 9, 2020 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcoyne/054937bd4f260c88ff69e21f99bb22cf to your computer and use it in GitHub Desktop.
Save jcoyne/054937bd4f260c88ff69e21f99bb22cf to your computer and use it in GitHub Desktop.
Descriptive metadata with recursion
openapi: 3.0.0
info:
description: Specification for Cocina Models
version: 1.0.0
title: Cocina Models
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
paths:
/validate/DescriptiveBasicValue:
post:
summary: Validate a DescriptiveBasicValue
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DescriptiveBasicValue'
responses:
'200':
description: noop
components:
schemas:
DescriptiveBasicValue:
description: Value model for descriptive elements without recursive properties.
type: object
additionalProperties: false
properties:
value:
description: String value of the descriptive element.
type: string
type:
description: Type of value provided by the descriptive element.
type: string
structuredValue:
$ref: "#/components/schemas/DescriptiveStructuredValue"
DescriptiveStructuredValue:
description: Value model for descriptive elements structured as typed values.
type: object
additionalProperties: false
properties:
structuredValue:
type: array
items:
$ref: "#/components/schemas/DescriptiveBasicValue"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment