Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Created June 10, 2020 20:03
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/ea8bb106fb3c171f7138037aebb24b37 to your computer and use it in GitHub Desktop.
Save jcoyne/ea8bb106fb3c171f7138037aebb24b37 to your computer and use it in GitHub Desktop.
Example with Openapi3Parser::Error::InvalidData
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/Description:
post:
summary: Validate a Description
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Description'
responses:
'200':
description: noop
components:
schemas:
AppliesTo:
description: Property model for indicating the parts, aspects, or versions of the resource to which a
descriptive element is applicable.
type: object
additionalProperties: false
properties:
appliesTo:
type: array
items:
$ref: "#/components/schemas/DescriptiveBasicValue"
Contributor:
description: Property model for describing agents contributing in some way to
the creation and history of the resource.
type: object
additionalProperties: false
properties:
name:
description: Names associated with a contributor.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
type:
description: Entity type of the contributor (person, organization, etc.).
type: string
status:
description: Status of the contributor relative to other parallel contributors.
type: string
role:
description: Relationships of the contributor to the resource or to an event
in its history.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
identifier:
description: Identifiers and URIs associated with the contributor entity.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
note:
description: Other information associated with the contributor.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
Description:
type: object
additionalProperties: false
properties:
title:
description: Titles of the resource.
type: array
minItems: 1
items:
$ref: "#/components/schemas/DescriptiveValueRequired"
contributor:
description: Agents contributing in some way to the creation and history of the
resource.
type: array
items:
$ref: "#/components/schemas/Contributor"
form:
description: Characteristics of the resource's physical, digital, and intellectual
form and genre.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
note:
description: Additional information relevant to a resource.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
identifier:
description: Identifiers and URIs associated with the resource.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
subject:
description: Terms associated with the intellectual content of the resource.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
purl:
description: Stanford persistent URL associated with the resource.
type: string
format: uri
access:
$ref: "#/components/schemas/DescriptiveAccessMetadata"
marcEncodedData:
description: Data about the resource represented in MARC fixed fields and codes.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
adminMetadata:
$ref: "#/components/schemas/DescriptiveAdminMetadata"
required:
- title
DescriptiveAccessMetadata:
description: Information about how to access digital and physical versions of the object.
type: object
additionalProperties: false
properties:
url:
description: URLs where the resource may be accessed in full or part.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
physicalLocation:
description: Location of a physical version of the resource.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
accessContact:
description: The library, organization, or person responsible for access to the resource.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
digitalRepository:
description: The digital repositories that hold the resource.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
note:
description: Other information related to accessing the resource.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
DescriptiveAdminMetadata:
description: Information about this resource description.
type: object
additionalProperties: false
properties:
contributor:
description: Contributors to this resource description.
type: array
items:
$ref: "#/components/schemas/Contributor"
note:
description: Other information related to this resource description.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
identifier:
description: Identifiers associated with this resource description.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
DescriptiveBasicValue:
description: Basic value model for descriptive elements.
type: object
additionalProperties: false
allOf:
- $ref: "#/components/schemas/DescriptiveStructuredValue"
- $ref: "#/components/schemas/DescriptiveParallelValue"
- 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
status:
description: Status of the descriptive element value relative to other instances
of the element.
type: string
code:
description: Code value of the descriptive element.
type: string
uri:
description: URI value of the descriptive element.
type: string
format: uri
standard:
description: Descriptive or content standard to which the value conforms.
$ref: "#/components/schemas/Standard"
note:
description: Other information related to the descriptive element.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
DescriptiveParallelValue:
description: Value model for multiple representations of the same information (e.g. in different languages).
type: object
additionalProperties: false
properties:
parallelValue:
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
DescriptiveStructuredValue:
description: Value model for descriptive elements structured as typed, ordered values.
type: object
additionalProperties: false
properties:
structuredValue:
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
DescriptiveValue:
description: Default value model for descriptive elements.
type: object
additionalProperties: false
allOf:
- $ref: "#/components/schemas/DescriptiveBasicValue"
- $ref: "#/components/schemas/AppliesTo"
DescriptiveValueRequired:
type: object
additionalProperties: false
allOf:
- $ref: "#/components/schemas/DescriptiveValue"
- anyOf:
- type: object
required:
- value
- type: object
required:
- structuredValue
Standard:
description: Property model for indicating the encoding, standard, or syntax
to which a value conforms.
type: object
additionalProperties: false
properties:
code:
description: Code representing the standard or encoding.
type: string
uri:
description: URI for the standard or encoding.
type: string
format: uri
value:
description: String describing the standard or encoding.
type: string
note:
description: Other information related to the standard or encoding.
type: array
items:
$ref: "#/components/schemas/DescriptiveValue"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment