From e2a5a194f219946b59d5dfb440975178609cba50 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Thu, 23 Sep 2021 15:08:29 +0200 Subject: [PATCH] PHRAS-3531_wrong-doc-apiv3 fix documentation for the result of POST:record fix how_to --- doc/API_documentation/v3/_HowTo_Swagger.md | 2 +- doc/API_documentation/v3/_compiled.yaml | 139 +-------------------- doc/API_documentation/v3/api.yaml | 2 +- doc/API_documentation/v3/record.yaml | 18 +++ 4 files changed, 26 insertions(+), 135 deletions(-) diff --git a/doc/API_documentation/v3/_HowTo_Swagger.md b/doc/API_documentation/v3/_HowTo_Swagger.md index 2959ffd45f..e0f8b2b779 100644 --- a/doc/API_documentation/v3/_HowTo_Swagger.md +++ b/doc/API_documentation/v3/_HowTo_Swagger.md @@ -13,7 +13,7 @@ to update in swaggerhub (single file) : - compile sources in a single file for swaggerhub (run from ) - `swagger-cli bundle API_documentation/v3/api.yaml -r -o API_documentation/v3/_compiled.yaml -t yaml` + `swagger-cli bundle doc/API_documentation/v3/api.yaml -r -o doc/API_documentation/v3/_compiled.yaml -t yaml` - copy/paste the generated content from `_compiled.yaml` to diff --git a/doc/API_documentation/v3/_compiled.yaml b/doc/API_documentation/v3/_compiled.yaml index de7f88ada3..892d981a73 100644 --- a/doc/API_documentation/v3/_compiled.yaml +++ b/doc/API_documentation/v3/_compiled.yaml @@ -2239,139 +2239,12 @@ paths: type: string example: UTF-8 response: - allOf: - - type: object - properties: - databox_id: - type: integer - example: 2 - record_id: - type: integer - example: 34 - updated_on: - type: string - format: date-time - created_on: - type: string - format: date-time - collection_id: - type: integer - example: 5 - base_id: - type: integer - example: 14 - thumbnail: - allOf: - - type: object - properties: - name: - example: thumbnail - mime_type: - example: image/jpeg - height: - example: 160 - width: - example: 240 - filesize: - example: 2375 - url: - example: 'http://phraseanet.demo.fr/medias/eyJ0eXAiOiJKV1Q...' - - type: object - properties: - name: - type: string - permalink: - type: object - properties: - created_on: - type: string - format: date-time - id: - type: integer - is_activated: - type: boolean - label: - type: string - updated_on: - type: string - format: date-time - page_url: - type: string - download_url: - type: string - url: - type: string - height: - type: integer - width: - type: integer - filesize: - type: integer - devices: - type: array - items: - type: string - enum: - - screen - - printer ? - player_type: - type: string - enum: - - IMAGE - mime_type: - type: string - substituted: - type: boolean - example: false - created_on: - type: string - format: date-time - updated_on: - type: string - format: date-time - url: - type: string - url_ttl: - type: integer - example: 7200 - uuid: - type: string - example: 5b079f33-0851-4aec-a978-b7f8d7204e5a - - type: object - properties: - mime_type: - type: string - example: image/jpeg - title: - type: string - example: Sleepy cat - original_name: - type: string - example: DSC_12345.jpg - technical_informations: - type: array - items: - type: object - additionalProperties: - type: string - example: - Aperture: 6.3 - CameraModel: Canon EOS 5D Mark II - Channels: 3 - ColorSpace: RGB - FileSize: 5618218 - sha256: - type: string - example: 6f330ac0ae2... - phrasea_type: - type: string - enum: - - image - - video - example: image - is_story: - type: boolean - default: false + type: object + properties: + url: + type: string + description: Api request to get the created record + example: /records/29/215/ default: description: Any other error '/stories/{sbas_id}/{record_id}': diff --git a/doc/API_documentation/v3/api.yaml b/doc/API_documentation/v3/api.yaml index b4a8e68cd7..d953a93ac6 100644 --- a/doc/API_documentation/v3/api.yaml +++ b/doc/API_documentation/v3/api.yaml @@ -693,7 +693,7 @@ paths: content: application/json: schema: - $ref: record.yaml#/ApiResponse_record + $ref: record.yaml#/ApiResponse_record_reference default: $ref: 'common.yaml#/error_response' # security: diff --git a/doc/API_documentation/v3/record.yaml b/doc/API_documentation/v3/record.yaml index 568e81eb50..f121c7cc46 100644 --- a/doc/API_documentation/v3/record.yaml +++ b/doc/API_documentation/v3/record.yaml @@ -114,11 +114,21 @@ type: boolean default: false + Record_reference: + type: object + properties: + url: + type: string + description: Api request to get the created record + example: + '/records/29/215/' + Record_extended: allOf: - $ref: '#/Record' - $ref: '#/_record_extension_' + Story: allOf: # Combines the basic _Record_ and the stories-only properties - $ref: '#/_Record_' @@ -253,6 +263,14 @@ response: $ref: '#/Record_extended' + ApiResponse_record_reference: + type: object + properties: + meta: + $ref: 'common.yaml#/ApiResponse_meta' + response: + $ref: '#/Record_reference' + ApiResponse_story: type: object properties: