Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #191 from vimeo/openapi-array-subtypes
Browse files Browse the repository at this point in the history
Fixing a bug in OAS compilation where arrays with subtypes were compiled as strings
  • Loading branch information
erunion committed Jul 27, 2018
2 parents d509ed8 + c8e5461 commit faa0ac0
Show file tree
Hide file tree
Showing 17 changed files with 679 additions and 36 deletions.
6 changes: 3 additions & 3 deletions resources/examples/Showtimes/compiled/1.0/openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ components:
cast:
description: 'Cast. This data requires a bearer token with the `public` scope.'
items:
type: string
$ref: '#/components/schemas/person'
type: array
content_rating:
description: 'MPAA rating'
Expand Down Expand Up @@ -515,7 +515,7 @@ components:
theaters:
description: 'Theaters the movie is currently showing in'
items:
type: string
$ref: '#/components/schemas/theater'
type: array
uri:
description: 'Movie URI'
Expand Down Expand Up @@ -545,7 +545,7 @@ components:
movies:
description: 'Movies currently playing'
items:
type: string
$ref: '#/components/schemas/movie'
type: array
name:
description: Name
Expand Down
34 changes: 32 additions & 2 deletions resources/examples/Showtimes/compiled/1.0/openapi/tags/Movies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ components:
cast:
description: 'Cast. This data requires a bearer token with the `public` scope.'
items:
type: string
$ref: '#/components/schemas/person'
type: array
content_rating:
description: 'MPAA rating'
Expand Down Expand Up @@ -297,7 +297,7 @@ components:
theaters:
description: 'Theaters the movie is currently showing in'
items:
type: string
$ref: '#/components/schemas/theater'
type: array
uri:
description: 'Movie URI'
Expand All @@ -316,6 +316,36 @@ components:
uri:
description: 'Person URI'
type: string
theater:
properties:
address:
description: Address
type: string
id:
description: 'Unique ID'
type: number
movies:
description: 'Movies currently playing'
items:
$ref: '#/components/schemas/movie'
type: array
name:
description: Name
type: string
phone_number:
description: 'Phone number'
type: string
showtimes:
description: 'Non-movie specific showtimes'
items:
type: string
type: array
uri:
description: 'Theater URI'
type: string
website:
description: Website
type: string
security:
-
oauth2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,88 @@ components:
error:
description: 'User-friendly error message'
type: string
movie:
properties:
cast:
description: 'Cast. This data requires a bearer token with the `public` scope.'
items:
$ref: '#/components/schemas/person'
type: array
content_rating:
description: 'MPAA rating'
enum:
- G
- NC-17
- NR
- PG
- PG-13
- R
- UR
- X
example: G
type: string
description:
description: Description
type: string
director:
allOf:
-
$ref: '#/components/schemas/person'
description: 'Director. This data requires a bearer token with the `public` scope.'
genres:
description: Genres
items:
type: string
type: array
id:
description: 'Unique ID'
type: number
kid_friendly:
description: 'Kid friendly?'
example: 'false'
type: boolean
name:
description: Name
type: string
purchase:
properties:
url:
description: 'URL to purchase the film.'
type: string
type: object
rotten_tomatoes_score:
description: 'Rotten Tomatoes score'
type: number
runtime:
description: Runtime
type: string
showtimes:
description: 'Non-theater specific showtimes'
items:
type: string
type: array
theaters:
description: 'Theaters the movie is currently showing in'
items:
$ref: '#/components/schemas/theater'
type: array
uri:
description: 'Movie URI'
type: string
person:
properties:
id:
description: 'Unique ID'
type: number
imdb:
description: 'IMDB URL'
type: string
name:
description: Name
type: string
uri:
description: 'Person URI'
type: string
theater:
properties:
address:
Expand All @@ -274,7 +356,7 @@ components:
movies:
description: 'Movies currently playing'
items:
type: string
$ref: '#/components/schemas/movie'
type: array
name:
description: Name
Expand Down
6 changes: 3 additions & 3 deletions resources/examples/Showtimes/compiled/1.1.1/openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ components:
cast:
description: 'Cast. This data requires a bearer token with the `public` scope.'
items:
type: string
$ref: '#/components/schemas/person'
type: array
content_rating:
description: 'MPAA rating'
Expand Down Expand Up @@ -692,7 +692,7 @@ components:
theaters:
description: 'Theaters the movie is currently showing in'
items:
type: string
$ref: '#/components/schemas/theater'
type: array
uri:
description: 'Movie URI'
Expand Down Expand Up @@ -722,7 +722,7 @@ components:
movies:
description: 'Movies currently playing'
items:
type: string
$ref: '#/components/schemas/movie'
type: array
name:
description: Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ components:
cast:
description: 'Cast. This data requires a bearer token with the `public` scope.'
items:
type: string
$ref: '#/components/schemas/person'
type: array
content_rating:
description: 'MPAA rating'
Expand Down Expand Up @@ -474,7 +474,7 @@ components:
theaters:
description: 'Theaters the movie is currently showing in'
items:
type: string
$ref: '#/components/schemas/theater'
type: array
uri:
description: 'Movie URI'
Expand All @@ -493,6 +493,33 @@ components:
uri:
description: 'Person URI'
type: string
theater:
properties:
address:
description: Address
type: string
id:
description: 'Unique ID'
type: number
movies:
description: 'Movies currently playing'
items:
$ref: '#/components/schemas/movie'
type: array
name:
description: Name
type: string
phone_number:
description: 'Phone number'
type: string
showtimes:
description: 'Non-movie specific showtimes'
items:
type: string
type: array
uri:
description: 'Theater URI'
type: string
security:
-
oauth2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,105 @@ components:
error:
description: 'User-friendly error message'
type: string
movie:
properties:
cast:
description: 'Cast. This data requires a bearer token with the `public` scope.'
items:
$ref: '#/components/schemas/person'
type: array
content_rating:
description: 'MPAA rating'
enum:
- G
- NC-17
- NR
- PG
- PG-13
- R
- UR
- X
example: G
type: string
description:
description: Description
type: string
director:
allOf:
-
$ref: '#/components/schemas/person'
description: 'Director. This data requires a bearer token with the `public` scope.'
external_urls:
description: 'External URLs. This data requires a bearer token with the `public` scope.'
items:
type: object
properties:
imdb:
description: 'IMDB URL. This data requires a bearer token with the `public` scope.'
type: string
tickets:
description: 'Tickets URL. This data requires a bearer token with the `public` scope.'
type: string
x-mill-vendor-tags:
- 'tag:BUY_TICKETS'
trailer:
description: 'Trailer URL. This data requires a bearer token with the `public` scope.'
type: string
type: array
genres:
description: Genres
items:
type: string
type: array
id:
description: 'Unique ID'
type: number
kid_friendly:
description: 'Kid friendly?'
example: 'false'
type: boolean
name:
description: Name
type: string
purchase:
properties:
url:
description: 'URL to purchase the film.'
type: string
type: object
rotten_tomatoes_score:
description: 'Rotten Tomatoes score'
type: number
runtime:
description: Runtime
type: string
showtimes:
description: 'Non-theater specific showtimes'
items:
type: string
type: array
theaters:
description: 'Theaters the movie is currently showing in'
items:
$ref: '#/components/schemas/theater'
type: array
uri:
description: 'Movie URI'
type: string
person:
properties:
id:
description: 'Unique ID'
type: number
imdb:
description: 'IMDB URL'
type: string
name:
description: Name
type: string
uri:
description: 'Person URI'
type: string
theater:
properties:
address:
Expand All @@ -274,7 +373,7 @@ components:
movies:
description: 'Movies currently playing'
items:
type: string
$ref: '#/components/schemas/movie'
type: array
name:
description: Name
Expand Down
Loading

0 comments on commit faa0ac0

Please sign in to comment.