-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9576 from ishaigor/master
Fixing support for references in Maps
- Loading branch information
Showing
5 changed files
with
302 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
...agger-codegen/src/test/resources/2_0/relative-ref/nested/directory/definitions/photos.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
swagger: '2.0' | ||
info: | ||
title: Photos API | ||
description: Photo service | ||
|
||
schemes: | ||
- http | ||
|
||
produces: | ||
- application/json | ||
|
||
# prefix for all paths | ||
# for breaking changes, we need to change the basePath and add a second swagger file | ||
basePath: /v1 | ||
|
||
paths: | ||
/photo/photos: | ||
post: | ||
operationId: getPhotos | ||
description: Retrieve photos by ids | ||
parameters: | ||
- name: photosRequest | ||
in: body | ||
required: true | ||
description: The photos being requested | ||
schema: | ||
$ref: '#/definitions/PhotosRequest' | ||
responses: | ||
200: | ||
description: A collection of Photos | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/definitions/Photo' | ||
|
||
definitions: | ||
Photo: | ||
properties: | ||
id: | ||
type: integer | ||
format: int32 | ||
description: The photo id (always present in the response) | ||
caption: | ||
type: string | ||
description: | | ||
Caption to be shown for the photo in the UI. | ||
uploadDate: | ||
type: string | ||
format: date | ||
description: The upload date for the image (requested using PhotoField.UPLOAD_DATE) | ||
uploadDateTime: | ||
type: string | ||
format: date-time | ||
description: The upload date-time (in UTC) for the image (requested using PhotoField.UPLOAD_DATETIME) | ||
|
||
PhotosRequest: | ||
required: | ||
- photoIds | ||
- photoFields | ||
properties: | ||
photoIds: | ||
type: array | ||
items: | ||
type: integer | ||
format: int32 | ||
photoFields: | ||
description: | | ||
The fields of a photo object to be retrieved. | ||
If none are specified, only the id comes back | ||
type: array | ||
items: | ||
$ref: '#/definitions/PhotoField' | ||
|
||
PhotoField: | ||
type: string | ||
enum: | ||
- CAPTION | ||
- UPLOAD_DATE | ||
- UPLOAD_DATETIME | ||
|
||
PhotoThumbnailsRequest: | ||
required: | ||
- ids | ||
- photoFields | ||
properties: | ||
ids: | ||
type: array | ||
items: | ||
type: integer | ||
format: int32 | ||
photoFields: | ||
description: | | ||
The fields of a photo object to be retrieved. | ||
If none are specified, only the id comes back | ||
type: array | ||
items: | ||
$ref: '#/definitions/PhotoField' |
104 changes: 104 additions & 0 deletions
104
...agger-codegen/src/test/resources/2_0/relative-ref/nested/directory/main/relative-refs.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
swagger: '2.0' | ||
info: | ||
title: API Definition with Relative models | ||
description: This is an example | ||
schemes: | ||
- https | ||
- http | ||
|
||
produces: | ||
- application/json | ||
|
||
basePath: /v1 | ||
|
||
paths: | ||
/photo/getPhotos: | ||
post: | ||
operationId: getPhotos | ||
description: Retrieve photos by ids | ||
parameters: | ||
- name: photosRequest | ||
in: body | ||
required: true | ||
description: The photos being requested | ||
schema: | ||
$ref: '../../../../relative-ref/nested/directory/definitions/photos.yml#/definitions/PhotosRequest' | ||
responses: | ||
200: | ||
description: A collection of Photos | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../../../../relative-ref/nested/directory/definitions/photos.yml#/definitions/Photo' | ||
|
||
/photo/{id}: | ||
get: | ||
operationId: get photo by Id | ||
description: Retrieve photo by id | ||
parameters: | ||
- name: "id" | ||
in: "path" | ||
description: "id" | ||
required: true | ||
type: integer | ||
format: int32 | ||
responses: | ||
200: | ||
description: A collection of Photos | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../../../../relative-ref/nested/directory/definitions/photos.yml#/definitions/Photo' | ||
|
||
/photo/getPhotoPreview/{id}: | ||
post: | ||
operationId: getPhotoPreview | ||
description: get thumbnail preview of a photo | ||
parameters: | ||
- name: id | ||
in: path | ||
type: integer | ||
minimum: 1 | ||
required: true | ||
description: the id of photo thumbnail requested | ||
responses: | ||
200: | ||
description: the response containing a preview thumbnail, along with some additional information about the photo | ||
schema: | ||
$ref: '#/definitions/PhotoPreview' | ||
|
||
/photo/thumbnails: | ||
post: | ||
operationId: getThumbnails | ||
description: Retrieve photo thumbnails by ids | ||
parameters: | ||
- name: photoThumbnailsRequest | ||
in: body | ||
required: true | ||
description: The photos being requested | ||
schema: | ||
$ref: '../../../../relative-ref/nested/directory/definitions/photos.yml#/definitions/PhotoThumbnailsRequest' | ||
responses: | ||
200: | ||
description: | | ||
A map of id -> photo for requested ids. | ||
schema: | ||
type: object | ||
additionalProperties: | ||
$ref: '../../../../relative-ref/nested/directory/definitions/photos.yml#/definitions/Photo' | ||
|
||
definitions: | ||
PhotoPreview: | ||
type: object | ||
properties: | ||
id: | ||
description: the id of the newly inserted photo | ||
type: integer | ||
format: int32 | ||
caption: | ||
description: the caption of the photo | ||
type: string | ||
thumbnail: | ||
description: The media binary of thumbnail | ||
type: string | ||
format: byte |