Skip to content

Commit

Permalink
Downgrade to Openapi v3.0.3 for better tooling support (#263)
Browse files Browse the repository at this point in the history
* Downgrade to Openapi v3.0.3 for better tooling support

Current tooling & libraries generally do not yet support openapi
3.1.0. For instance, none of the data validation libraries at
https://openapi.tools/#data-validators supports it. 3.0.3 support is
widespread.

This change sets the version to 3.0.3 and fixes an issue with the
default values for the `sort` parameter, which should be an array, so
its default should also be an array.

Further consequences: the `duration` format is not explicitly
supported in 3.0.3, so strictly conforming validators will allow any
string value for `duration` fields. This patch replaces the `duration`
format with an explicit pattern matching the ISO8601 duration format.

* Added examples for the sort query parameter

Co-authored-by: Jelmer de Ronde <jelmer.deronde@surf.nl>
  • Loading branch information
joodie and jelmerderonde authored Jul 5, 2022
1 parent ff6aaa1 commit 6c24dcc
Show file tree
Hide file tree
Showing 37 changed files with 135 additions and 40 deletions.
5 changes: 4 additions & 1 deletion v5-rc/paths/AcademicSessionCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ get:
- -academicSessionId
- -name
- -startDate
default: startDate
default: [ startDate ]
example:
- startDate
- -academicSessionId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/AcademicSessionOfferingCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ get:
- -name
- -startDate
- -endDate
default: startDate
default: [ startDate ]
example:
- startDate
- -name
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/BuildingCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ get:
- name
- -buildingId
- -name
default: name
default: [ name ]
example:
- name
- -buildingId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/BuildingRoomCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ get:
- -name
- -totalSeats
- -availableSeats
default: name
default: [ name ]
example:
- name
- -availableSeats
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/ComponentOfferingCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ get:
- -name
- -startDateTime
- -endDateTime
default: startDateTime
default: [ startDateTime ]
example:
- offeringId
- -startDateTime
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/CourseCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ get:
- name
- -courseId
- -name
default: name
default: [ name ]
example:
- name
- -courseId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/CourseComponentCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ get:
- name
- -componentId
- -name
default: componentId
default: [ componentId ]
example:
- name
- -componentId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/CourseOfferingCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ get:
- -name
- -startDate
- -endDate
default: startDate
default: [ startDate ]
example:
- offeringId
- -endDate
responses:
'200':
description: OK
Expand Down
9 changes: 6 additions & 3 deletions v5-rc/paths/EducationSpecificationCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ get:
enum:
- educationSpecificationType
- name
- primarycode
- primaryCode
- -educationSpecificationType
- -name
- -primarycode
- -primaryCode
default:
- name
- [ name ]
example:
- educationSpecificationType
- -primaryCode
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/EducationSpecificationCourseCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ get:
- name
- -courseId
- -name
default: courseId
default: [ courseId ]
example:
- courseId
- -name
responses:
'200':
description: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ get:
- -educationSpecificationId
- -name
- -educationSpecificationType
default: educationSpecificationId
default: [ educationSpecificationId ]
example:
- educationSpecificationId
- -name
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/EducationSpecificationProgramCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ get:
- name
- -programId
- -name
default: name
default: [ name ]
example:
- programId
- -name
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/GroupCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ get:
- -groupId
- -name
- -startDate
default: name
default: [ name ]
example:
- groupId
- -startDate
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/GroupPersonCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ get:
- -givenName
- -surName
- -displayName
default: personId
default: [ personId ]
example:
- personId
- -givenName
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/NewsFeedCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ get:
- name
- -newsFeedId
- -name
default: name
default: [ name ]
example:
- name
- -newsFeedId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/NewsFeedItemCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ get:
- -validFrom
- -validUntil
- -lastModified
default: newsItemId
default: [ newsItemId ]
example:
- validFrom
- -name
responses:
'200':
description: OK
Expand Down
3 changes: 2 additions & 1 deletion v5-rc/paths/OfferingAssociationCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ get:
$ref: '../enumerations/resultState.yaml'
- name: sort
in: query

description: 'Sort by one or more attributes, the default is ascending. Prefixing the attribute with a minus sign `-` allows for descending sort. Examples: [ATTR | -ATTR | ATTR1,-ATTR2]'
required: false
schema:
Expand All @@ -56,6 +55,8 @@ get:
- -associationId
default:
- associationId
example:
- associationId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/OfferingGroupCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ get:
- -groupId
- -name
- -startDate
default: name
default: [ name ]
example:
- name
- -startDate
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/OrganizationCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ get:
- name
- -organizationId
- -name
default: name
default: [ name ]
example:
- name
- -organizationId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/OrganizationComponentCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ get:
- name
- -componentId
- -name
default: name
default: [ name ]
example:
- componentId
- -name
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/OrganizationCourseCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ get:
- name
- -courseId
- -name
default: name
default: [ name ]
example:
- name
- -courseId
responses:
'200':
description: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ get:
- -educationSpecificationType
- -name
- -primarycode
default: name
default: [ name ]
example:
- name
- -educationSpecificationType
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/OrganizationGroupCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ get:
- -groupId
- -name
- -startDate
default: name
default: [ name ]
example:
- groupId
- -name
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/OrganizationOfferingCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ get:
- -name
- -startDate
- -endDate
default: startDate
default: [ startDate ]
example:
- name
- -startDate
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/OrganizationProgramCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ get:
- name
- -programId
- -name
default: name
default: [ name ]
example:
- name
- -programId
responses:
'200':
description: OK
Expand Down
4 changes: 3 additions & 1 deletion v5-rc/paths/PersonAssociationCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ get:
enum:
- associationId
- -associationId
default: associationId
default: [ associationId ]
example:
- associationId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/PersonCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ get:
- -givenName
- -surName
- -displayName
default: personId
default: [ personId ]
example:
- surName
- -personId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/PersonGroupCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ get:
- -groupId
- -name
- -startDate
default: name
default: [ name ]
example:
- name
- -groupId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/ProgramCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ get:
- name
- -programId
- -name
default: name
default: [ name ]
sort:
- name
- programId
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/ProgramCourseCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ get:
- name
- -courseId
- -name
default: courseId
default: [ courseId ]
example:
- name
- -courseId
responses:
'200':
description: OK
Expand Down
6 changes: 4 additions & 2 deletions v5-rc/paths/ProgramOfferingCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ get:
- -name
- -startDate
- -endDate
default:
- startDate
default: [ startDate ]
example:
- name
- -startDate
responses:
'200':
description: OK
Expand Down
5 changes: 4 additions & 1 deletion v5-rc/paths/ProgramProgramCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ get:
- name
- -programId
- -name
default: name
default: [ name ]
example:
- name
- -programId
responses:
'200':
description: OK
Expand Down
Loading

0 comments on commit 6c24dcc

Please sign in to comment.