Skip to content

Commit

Permalink
Refactor to make event patching sensible and fix a problem with an allOf
Browse files Browse the repository at this point in the history
  • Loading branch information
lornajane committed Oct 7, 2024
1 parent 8816874 commit b859726
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
23 changes: 20 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/SpecialEvent"
$ref: "#/components/schemas/SpecialEventFields"
examples:
default_example:
$ref: "#/components/examples/UpdateSpecialEventRequestExample"
Expand Down Expand Up @@ -238,9 +238,13 @@ components:
example: [email protected]
BuyMuseumTickets:
description: Data to purchase a ticket.
type: object
allOf:
- type: object
properties:
email:
$ref: "#/components/schemas/Email"
- $ref: "#/components/schemas/Ticket"
- $ref: "#/components/schemas/Email"
TicketMessage:
description: Confirmation message after a ticket purchase.
type: string
Expand Down Expand Up @@ -342,6 +346,19 @@ components:
type: number
format: float
example: 25
SpecialEventFields:
type: object
properties:
name:
$ref: "#/components/schemas/EventName"
location:
$ref: "#/components/schemas/EventLocation"
eventDescription:
$ref: "#/components/schemas/EventDescription"
dates:
$ref: "#/components/schemas/EventDates"
price:
$ref: "#/components/schemas/EventPrice"
SpecialEvent:
type: object
properties:
Expand Down Expand Up @@ -392,7 +409,7 @@ components:
BuyEventTicketsRequestExample:
summary: Special event ticket
value:
ticketType: general
ticketType: event
eventId: dad4bce8-f5cb-4078-a211-995864315e39
ticketDate: '2023-09-05'
email: [email protected]
Expand Down
4 changes: 3 additions & 1 deletion redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ extends:
rules:
operation-tag-defined: error
no-invalid-schema-examples: error
no-invalid-media-type-examples: off # Check support for readOnly fields
no-invalid-media-type-examples:
severity: error
allowAdditionalProperties: true
scalar-property-missing-example: error
rule/operation-summary-sentence-case:
subject:
Expand Down

0 comments on commit b859726

Please sign in to comment.