diff --git a/src/Graviton/RestBundle/Resources/config/schema/openapi.yaml b/src/Graviton/RestBundle/Resources/config/schema/openapi.yaml index c3374cbfa..d764f5db4 100644 --- a/src/Graviton/RestBundle/Resources/config/schema/openapi.yaml +++ b/src/Graviton/RestBundle/Resources/config/schema/openapi.yaml @@ -7,39 +7,69 @@ components: $ref: type: string description: An url to point to. + GravitonPatchBody: type: array items: - type: object - description: A JSONPatch document as defined by RFC 6902 - required: - - "op" - - "path" - properties: - op: - type: string - description: The operation to be performed - enum: - - "add" - - "remove" - - "replace" - - "move" - - "copy" - - "test" - path: - type: string - description: A JSON-Pointer - value: - oneOf: - - type: string - - type: object - additionalProperties: true - - type: boolean - - type: array - items: - type: object - additionalProperties: true - - type: number - from: - type: string - description: A string containing a JSON Pointer value. + oneOf: + - $ref: '#/components/schemas/JSONPatchRequestAddReplaceTest' + - $ref: '#/components/schemas/JSONPatchRequestRemove' + - $ref: '#/components/schemas/JSONPatchRequestMoveCopy' + + JSONPatchRequestAddReplaceTest: + type: object + additionalProperties: false + required: + - value + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + value: + description: The value to add, replace or test. + op: + description: The operation to perform. + type: string + enum: + - add + - replace + - test + JSONPatchRequestRemove: + type: object + additionalProperties: false + required: + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + op: + description: The operation to perform. + type: string + enum: + - remove + JSONPatchRequestMoveCopy: + type: object + additionalProperties: false + required: + - from + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + op: + description: The operation to perform. + type: string + enum: + - move + - copy + from: + description: A JSON Pointer path. + type: string + +