File: alternative_schema_examples.md

package info (click to toggle)
openapi-specification 3.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,212 kB
  • sloc: makefile: 5
file content (53 lines) | stat: -rw-r--r-- 1,387 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## Change: Add Alternative Schema Examples

The following text is to be inserted after the Alternative Schema Object section.

### Alternative Schema Examples

Minimalist usage of alternative schema:

    schema:
        x-oas-draft-alternativeSchema:
          type: jsonSchema
          location: ./real-jsonschema.json

Combination of OAS schema and alternative:

    schema:
        type: object
        nullable: true
        x-oas-draft-alternativeSchema:
            type: jsonSchema
            location: ./real-jsonschema.json

Multiple different versions of alternative schema:

    schema:
        anyOf:
            - x-oas-draft-alternativeSchema:
                type: jsonSchema
                location: ./real-jsonschema-08.json
            - x-oas-draft-alternativeSchema:
                type: jsonSchema
                location: ./real-jsonschema-07.json

Combined alternative schemas:

    schema:
        allOf:
            - x-oas-draft-alternativeSchema:
                type: xmlSchema
                location: ./xmlSchema.xsd
            - x-oas-draft-alternativeSchema:
                type: schematron
                location: ./schema.sch

Mixed OAS schema and alternative schema:

    schema:
        type: array
        items:
            x-oas-draft-alternativeSchema:
                type: jsonSchema
                location: ./real-jsonschema.json