Combine HTTP Methods in `patternProperties`
MODIFY
schemas/v3.0/README.md
schemas/v3.0/README.md
@@ -22,3 +22,10 @@ Such data would become invalid:
```json
{"$ref": "#", "unknown": 1}
```
+
+## Combine HTTP Methods in `patternProperties`
+
+```yaml
+patternProperties:
+ '^(get|put|post|delete|options|head|patch|trace)$': $ref: '#/definitions/Operation'
+```

MODIFY
schemas/v3.0/schema.yaml
schemas/v3.0/schema.yaml
@@ -556,22 +556,6 @@ definitions:
type: string
description:
type: string
- get:
- $ref: '#/definitions/Operation'
- put:
- $ref: '#/definitions/Operation'
- post:
- $ref: '#/definitions/Operation'
- delete:
- $ref: '#/definitions/Operation'
- options:
- $ref: '#/definitions/Operation'
- head:
- $ref: '#/definitions/Operation'
- patch:
- $ref: '#/definitions/Operation'
- trace:
- $ref: '#/definitions/Operation'
servers:
type: array
items:
@@ -584,6 +568,8 @@ definitions:
- $ref: '#/definitions/Reference'
uniqueItems: true
patternProperties:
+ '^(get|put|post|delete|options|head|patch|trace)$':
+ $ref: '#/definitions/Operation'
'^x-': {}
additionalProperties: false

Combine HTTP Methods in `patternProperties`