From 061e66c4c41063e6b7321f1f421b5152e9e5a84d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 13 Dec 2018 19:36:25 +0800 Subject: schema tweaks, and rust codegen --- rust/fatcat-api-spec/api/swagger.yaml | 1364 +++++++++++++++++++++++++++++++-- 1 file changed, 1291 insertions(+), 73 deletions(-) (limited to 'rust/fatcat-api-spec/api') diff --git a/rust/fatcat-api-spec/api/swagger.yaml b/rust/fatcat-api-spec/api/swagger.yaml index 51f0630e..5891a24e 100644 --- a/rust/fatcat-api-spec/api/swagger.yaml +++ b/rust/fatcat-api-spec/api/swagger.yaml @@ -367,6 +367,76 @@ paths: path: "/container/:id" HttpMethod: "Delete" httpmethod: "delete" + /container/rev/{id}: + get: + tags: + - "containers" + operationId: "get_container_revision" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + - name: "expand" + in: "query" + description: "List of sub-entities to expand in response. For containers,\ + \ none accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"expand_example\".to_string())" + - name: "hide" + in: "query" + description: "List of entity fields to elide in response. For containers,\ + \ none accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"hide_example\".to_string())" + responses: + 200: + description: "Found Entity Revision" + schema: + $ref: "#/definitions/container_entity" + x-responseId: "FoundEntityRevision" + x-uppercaseResponseId: "FOUND_ENTITY_REVISION" + uppercase_operation_id: "GET_CONTAINER_REVISION" + uppercase_data_type: "CONTAINERENTITY" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_CONTAINER_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_CONTAINER_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_CONTAINER_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_container_revision" + uppercase_operation_id: "GET_CONTAINER_REVISION" + path: "/container/rev/:id" + HttpMethod: "Get" + httpmethod: "get" /container/{id}/history: get: tags: @@ -430,6 +500,62 @@ paths: path: "/container/:id/history" HttpMethod: "Get" httpmethod: "get" + /container/{id}/redirects: + get: + tags: + - "containers" + operationId: "get_container_redirects" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + responses: + 200: + description: "Found Entity Redirects" + schema: + type: "array" + items: + type: "string" + x-responseId: "FoundEntityRedirects" + x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" + uppercase_operation_id: "GET_CONTAINER_REDIRECTS" + uppercase_data_type: "VEC" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_CONTAINER_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_CONTAINER_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_CONTAINER_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_container_redirects" + uppercase_operation_id: "GET_CONTAINER_REDIRECTS" + path: "/container/:id/redirects" + HttpMethod: "Get" + httpmethod: "get" /container/lookup: get: tags: @@ -438,13 +564,18 @@ paths: parameters: - name: "issnl" in: "query" - required: true + required: false type: "string" maxLength: 9 minLength: 9 pattern: "\\d{4}-\\d{3}[0-9X]" - formatString: "\\\"{}\\\"" - example: "\"issnl_example\".to_string()" + formatString: "{:?}" + example: "Some(\"issnl_example\".to_string())" + - name: "wikidata_qid" + in: "query" + required: false + formatString: "{:?}" + example: "Some(\"wikidata_qid_example\".to_string())" - name: "hide" in: "query" description: "List of entity fields to elide in response. For container, none\ @@ -495,6 +626,115 @@ paths: path: "/container/lookup" HttpMethod: "Get" httpmethod: "get" + /container/edit/{edit_id}: + get: + tags: + - "containers" + operationId: "get_container_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Found Edit" + schema: + $ref: "#/definitions/entity_edit" + x-responseId: "FoundEdit" + x-uppercaseResponseId: "FOUND_EDIT" + uppercase_operation_id: "GET_CONTAINER_EDIT" + uppercase_data_type: "ENTITYEDIT" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_container_edit" + uppercase_operation_id: "GET_CONTAINER_EDIT" + path: "/container/edit/:edit_id" + HttpMethod: "Get" + httpmethod: "get" + delete: + tags: + - "containers" + operationId: "delete_container_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Deleted Edit" + schema: + $ref: "#/definitions/success" + x-responseId: "DeletedEdit" + x-uppercaseResponseId: "DELETED_EDIT" + uppercase_operation_id: "DELETE_CONTAINER_EDIT" + uppercase_data_type: "SUCCESS" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "DELETE_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "DELETE_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "DELETE_CONTAINER_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "delete_container_edit" + uppercase_operation_id: "DELETE_CONTAINER_EDIT" + path: "/container/edit/:edit_id" + HttpMethod: "Delete" + httpmethod: "delete" /creator: post: tags: @@ -841,6 +1081,76 @@ paths: path: "/creator/:id" HttpMethod: "Delete" httpmethod: "delete" + /creator/rev/{id}: + get: + tags: + - "creators" + operationId: "get_creator_revision" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + - name: "expand" + in: "query" + description: "List of sub-entities to expand in response. For creators, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"expand_example\".to_string())" + - name: "hide" + in: "query" + description: "List of entity fields to elide in response. For creators, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"hide_example\".to_string())" + responses: + 200: + description: "Found Entity Revision" + schema: + $ref: "#/definitions/creator_entity" + x-responseId: "FoundEntityRevision" + x-uppercaseResponseId: "FOUND_ENTITY_REVISION" + uppercase_operation_id: "GET_CREATOR_REVISION" + uppercase_data_type: "CREATORENTITY" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_CREATOR_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_CREATOR_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_CREATOR_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_creator_revision" + uppercase_operation_id: "GET_CREATOR_REVISION" + path: "/creator/rev/:id" + HttpMethod: "Get" + httpmethod: "get" /creator/{id}/history: get: tags: @@ -968,21 +1278,82 @@ paths: path: "/creator/:id/releases" HttpMethod: "Get" httpmethod: "get" - /creator/lookup: + /creator/{id}/redirects: get: tags: - "creators" - operationId: "lookup_creator" + operationId: "get_creator_redirects" parameters: - - name: "orcid" - in: "query" + - name: "id" + in: "path" required: true type: "string" - maxLength: 19 - minLength: 19 - pattern: "\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]" formatString: "\\\"{}\\\"" - example: "\"orcid_example\".to_string()" + example: "\"id_example\".to_string()" + responses: + 200: + description: "Found Entity Redirects" + schema: + type: "array" + items: + type: "string" + x-responseId: "FoundEntityRedirects" + x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" + uppercase_operation_id: "GET_CREATOR_REDIRECTS" + uppercase_data_type: "VEC" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_CREATOR_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_CREATOR_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_CREATOR_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_creator_redirects" + uppercase_operation_id: "GET_CREATOR_REDIRECTS" + path: "/creator/:id/redirects" + HttpMethod: "Get" + httpmethod: "get" + /creator/lookup: + get: + tags: + - "creators" + operationId: "lookup_creator" + parameters: + - name: "orcid" + in: "query" + required: false + type: "string" + maxLength: 19 + minLength: 19 + pattern: "\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]" + formatString: "{:?}" + example: "Some(\"orcid_example\".to_string())" + - name: "wikidata_qid" + in: "query" + required: false + formatString: "{:?}" + example: "Some(\"wikidata_qid_example\".to_string())" - name: "hide" in: "query" description: "List of entity fields to elide in response. For creator, none\ @@ -1033,6 +1404,115 @@ paths: path: "/creator/lookup" HttpMethod: "Get" httpmethod: "get" + /creator/edit/{edit_id}: + get: + tags: + - "creators" + operationId: "get_creator_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Found Edit" + schema: + $ref: "#/definitions/entity_edit" + x-responseId: "FoundEdit" + x-uppercaseResponseId: "FOUND_EDIT" + uppercase_operation_id: "GET_CREATOR_EDIT" + uppercase_data_type: "ENTITYEDIT" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_creator_edit" + uppercase_operation_id: "GET_CREATOR_EDIT" + path: "/creator/edit/:edit_id" + HttpMethod: "Get" + httpmethod: "get" + delete: + tags: + - "creators" + operationId: "delete_creator_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Deleted Edit" + schema: + $ref: "#/definitions/success" + x-responseId: "DeletedEdit" + x-uppercaseResponseId: "DELETED_EDIT" + uppercase_operation_id: "DELETE_CREATOR_EDIT" + uppercase_data_type: "SUCCESS" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "DELETE_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "DELETE_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "DELETE_CREATOR_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "delete_creator_edit" + uppercase_operation_id: "DELETE_CREATOR_EDIT" + path: "/creator/edit/:edit_id" + HttpMethod: "Delete" + httpmethod: "delete" /file: post: tags: @@ -1379,6 +1859,76 @@ paths: path: "/file/:id" HttpMethod: "Delete" httpmethod: "delete" + /file/rev/{id}: + get: + tags: + - "files" + operationId: "get_file_revision" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + - name: "expand" + in: "query" + description: "List of sub-entities to expand in response. For files, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"expand_example\".to_string())" + - name: "hide" + in: "query" + description: "List of entity fields to elide in response. For files, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"hide_example\".to_string())" + responses: + 200: + description: "Found Entity Revision" + schema: + $ref: "#/definitions/file_entity" + x-responseId: "FoundEntityRevision" + x-uppercaseResponseId: "FOUND_ENTITY_REVISION" + uppercase_operation_id: "GET_FILE_REVISION" + uppercase_data_type: "FILEENTITY" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_FILE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_FILE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_FILE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_file_revision" + uppercase_operation_id: "GET_FILE_REVISION" + path: "/file/rev/:id" + HttpMethod: "Get" + httpmethod: "get" /file/{id}/history: get: tags: @@ -1442,18 +1992,86 @@ paths: path: "/file/:id/history" HttpMethod: "Get" httpmethod: "get" + /file/{id}/redirects: + get: + tags: + - "files" + operationId: "get_file_redirects" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + responses: + 200: + description: "Found Entity Redirects" + schema: + type: "array" + items: + type: "string" + x-responseId: "FoundEntityRedirects" + x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" + uppercase_operation_id: "GET_FILE_REDIRECTS" + uppercase_data_type: "VEC" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_FILE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_FILE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_FILE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_file_redirects" + uppercase_operation_id: "GET_FILE_REDIRECTS" + path: "/file/:id/redirects" + HttpMethod: "Get" + httpmethod: "get" /file/lookup: get: tags: - "files" operationId: "lookup_file" parameters: + - name: "md5" + in: "query" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"md5_example\".to_string())" - name: "sha1" in: "query" - required: true + required: false type: "string" - formatString: "\\\"{}\\\"" - example: "\"sha1_example\".to_string()" + formatString: "{:?}" + example: "Some(\"sha1_example\".to_string())" + - name: "sha256" + in: "query" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"sha256_example\".to_string())" - name: "hide" in: "query" description: "List of entity fields to elide in response. For files, none\ @@ -1504,14 +2122,123 @@ paths: path: "/file/lookup" HttpMethod: "Get" httpmethod: "get" - /release: - post: + /file/edit/{edit_id}: + get: tags: - - "releases" - operationId: "create_release" + - "files" + operationId: "get_file_edit" parameters: - - in: "body" - name: "entity" + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Found Edit" + schema: + $ref: "#/definitions/entity_edit" + x-responseId: "FoundEdit" + x-uppercaseResponseId: "FOUND_EDIT" + uppercase_operation_id: "GET_FILE_EDIT" + uppercase_data_type: "ENTITYEDIT" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_file_edit" + uppercase_operation_id: "GET_FILE_EDIT" + path: "/file/edit/:edit_id" + HttpMethod: "Get" + httpmethod: "get" + delete: + tags: + - "files" + operationId: "delete_file_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Deleted Edit" + schema: + $ref: "#/definitions/success" + x-responseId: "DeletedEdit" + x-uppercaseResponseId: "DELETED_EDIT" + uppercase_operation_id: "DELETE_FILE_EDIT" + uppercase_data_type: "SUCCESS" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "DELETE_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "DELETE_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "DELETE_FILE_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "delete_file_edit" + uppercase_operation_id: "DELETE_FILE_EDIT" + path: "/file/edit/:edit_id" + HttpMethod: "Delete" + httpmethod: "delete" + /release: + post: + tags: + - "releases" + operationId: "create_release" + parameters: + - in: "body" + name: "entity" required: true schema: $ref: "#/definitions/release_entity" @@ -1850,6 +2577,76 @@ paths: path: "/release/:id" HttpMethod: "Delete" httpmethod: "delete" + /release/rev/{id}: + get: + tags: + - "releases" + operationId: "get_release_revision" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + - name: "expand" + in: "query" + description: "List of sub-entities to expand in response. For releases, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"expand_example\".to_string())" + - name: "hide" + in: "query" + description: "List of entity fields to elide in response. For releases, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"hide_example\".to_string())" + responses: + 200: + description: "Found Entity Revision" + schema: + $ref: "#/definitions/release_entity" + x-responseId: "FoundEntityRevision" + x-uppercaseResponseId: "FOUND_ENTITY_REVISION" + uppercase_operation_id: "GET_RELEASE_REVISION" + uppercase_data_type: "RELEASEENTITY" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_RELEASE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_RELEASE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_RELEASE_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_release_revision" + uppercase_operation_id: "GET_RELEASE_REVISION" + path: "/release/rev/:id" + HttpMethod: "Get" + httpmethod: "get" /release/{id}/history: get: tags: @@ -1935,15 +2732,212 @@ paths: example: "Some(\"hide_example\".to_string())" responses: 200: - description: "Found" + description: "Found" + schema: + type: "array" + items: + $ref: "#/definitions/file_entity" + x-responseId: "Found" + x-uppercaseResponseId: "FOUND" + uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_data_type: "VEC" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_release_files" + uppercase_operation_id: "GET_RELEASE_FILES" + path: "/release/:id/files" + HttpMethod: "Get" + httpmethod: "get" + /release/{id}/redirects: + get: + tags: + - "releases" + operationId: "get_release_redirects" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + responses: + 200: + description: "Found Entity Redirects" + schema: + type: "array" + items: + type: "string" + x-responseId: "FoundEntityRedirects" + x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" + uppercase_operation_id: "GET_RELEASE_REDIRECTS" + uppercase_data_type: "VEC" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_RELEASE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_RELEASE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_RELEASE_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_release_redirects" + uppercase_operation_id: "GET_RELEASE_REDIRECTS" + path: "/release/:id/redirects" + HttpMethod: "Get" + httpmethod: "get" + /release/lookup: + get: + tags: + - "releases" + operationId: "lookup_release" + parameters: + - name: "doi" + in: "query" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"doi_example\".to_string())" + - name: "wikidata_qid" + in: "query" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"wikidata_qid_example\".to_string())" + - name: "isbn13" + in: "query" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"isbn13_example\".to_string())" + - name: "pmid" + in: "query" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"pmid_example\".to_string())" + - name: "pmcid" + in: "query" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"pmcid_example\".to_string())" + - name: "hide" + in: "query" + description: "List of entity fields to elide in response. For releases, 'abstracts',\ + \ 'refs', and 'contribs' are valid." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"hide_example\".to_string())" + responses: + 200: + description: "Found Entity" + schema: + $ref: "#/definitions/release_entity" + x-responseId: "FoundEntity" + x-uppercaseResponseId: "FOUND_ENTITY" + uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_data_type: "RELEASEENTITY" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "lookup_release" + uppercase_operation_id: "LOOKUP_RELEASE" + path: "/release/lookup" + HttpMethod: "Get" + httpmethod: "get" + /release/edit/{edit_id}: + get: + tags: + - "releases" + operationId: "get_release_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Found Edit" schema: - type: "array" - items: - $ref: "#/definitions/file_entity" - x-responseId: "Found" - x-uppercaseResponseId: "FOUND" - uppercase_operation_id: "GET_RELEASE_FILES" - uppercase_data_type: "VEC" + $ref: "#/definitions/entity_edit" + x-responseId: "FoundEdit" + x-uppercaseResponseId: "FOUND_EDIT" + uppercase_operation_id: "GET_RELEASE_EDIT" + uppercase_data_type: "ENTITYEDIT" producesJson: true 400: description: "Bad Request" @@ -1951,7 +2945,7 @@ paths: $ref: "#/definitions/error_response" x-responseId: "BadRequest" x-uppercaseResponseId: "BAD_REQUEST" - uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_operation_id: "GET_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true 404: @@ -1960,7 +2954,7 @@ paths: $ref: "#/definitions/error_response" x-responseId: "NotFound" x-uppercaseResponseId: "NOT_FOUND" - uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_operation_id: "GET_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true 500: @@ -1969,43 +2963,35 @@ paths: $ref: "#/definitions/error_response" x-responseId: "GenericError" x-uppercaseResponseId: "GENERIC_ERROR" - uppercase_operation_id: "GET_RELEASE_FILES" + uppercase_operation_id: "GET_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true - operation_id: "get_release_files" - uppercase_operation_id: "GET_RELEASE_FILES" - path: "/release/:id/files" + operation_id: "get_release_edit" + uppercase_operation_id: "GET_RELEASE_EDIT" + path: "/release/edit/:edit_id" HttpMethod: "Get" httpmethod: "get" - /release/lookup: - get: + delete: tags: - "releases" - operationId: "lookup_release" + operationId: "delete_release_edit" parameters: - - name: "doi" - in: "query" + - name: "edit_id" + in: "path" required: true - type: "string" - formatString: "\\\"{}\\\"" - example: "\"doi_example\".to_string()" - - name: "hide" - in: "query" - description: "List of entity fields to elide in response. For releases, 'abstracts',\ - \ 'refs', and 'contribs' are valid." - required: false - type: "string" - formatString: "{:?}" - example: "Some(\"hide_example\".to_string())" + type: "integer" + format: "int64" + formatString: "{}" + example: "789" responses: 200: - description: "Found Entity" + description: "Deleted Edit" schema: - $ref: "#/definitions/release_entity" - x-responseId: "FoundEntity" - x-uppercaseResponseId: "FOUND_ENTITY" - uppercase_operation_id: "LOOKUP_RELEASE" - uppercase_data_type: "RELEASEENTITY" + $ref: "#/definitions/success" + x-responseId: "DeletedEdit" + x-uppercaseResponseId: "DELETED_EDIT" + uppercase_operation_id: "DELETE_RELEASE_EDIT" + uppercase_data_type: "SUCCESS" producesJson: true 400: description: "Bad Request" @@ -2013,7 +2999,7 @@ paths: $ref: "#/definitions/error_response" x-responseId: "BadRequest" x-uppercaseResponseId: "BAD_REQUEST" - uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_operation_id: "DELETE_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true 404: @@ -2022,7 +3008,7 @@ paths: $ref: "#/definitions/error_response" x-responseId: "NotFound" x-uppercaseResponseId: "NOT_FOUND" - uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_operation_id: "DELETE_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true 500: @@ -2031,14 +3017,14 @@ paths: $ref: "#/definitions/error_response" x-responseId: "GenericError" x-uppercaseResponseId: "GENERIC_ERROR" - uppercase_operation_id: "LOOKUP_RELEASE" + uppercase_operation_id: "DELETE_RELEASE_EDIT" uppercase_data_type: "ERRORRESPONSE" producesJson: true - operation_id: "lookup_release" - uppercase_operation_id: "LOOKUP_RELEASE" - path: "/release/lookup" - HttpMethod: "Get" - httpmethod: "get" + operation_id: "delete_release_edit" + uppercase_operation_id: "DELETE_RELEASE_EDIT" + path: "/release/edit/:edit_id" + HttpMethod: "Delete" + httpmethod: "delete" /work: post: tags: @@ -2385,6 +3371,76 @@ paths: path: "/work/:id" HttpMethod: "Delete" httpmethod: "delete" + /work/rev/{id}: + get: + tags: + - "works" + operationId: "get_work_revision" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + - name: "expand" + in: "query" + description: "List of sub-entities to expand in response. For works, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"expand_example\".to_string())" + - name: "hide" + in: "query" + description: "List of entity fields to elide in response. For works, none\ + \ accepted (yet)." + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"hide_example\".to_string())" + responses: + 200: + description: "Found Entity Revision" + schema: + $ref: "#/definitions/work_entity" + x-responseId: "FoundEntityRevision" + x-uppercaseResponseId: "FOUND_ENTITY_REVISION" + uppercase_operation_id: "GET_WORK_REVISION" + uppercase_data_type: "WORKENTITY" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_WORK_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_WORK_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_WORK_REVISION" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_work_revision" + uppercase_operation_id: "GET_WORK_REVISION" + path: "/work/rev/:id" + HttpMethod: "Get" + httpmethod: "get" /work/{id}/history: get: tags: @@ -2448,6 +3504,62 @@ paths: path: "/work/:id/history" HttpMethod: "Get" httpmethod: "get" + /work/{id}/redirects: + get: + tags: + - "works" + operationId: "get_work_redirects" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"id_example\".to_string()" + responses: + 200: + description: "Found Entity Redirects" + schema: + type: "array" + items: + type: "string" + x-responseId: "FoundEntityRedirects" + x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" + uppercase_operation_id: "GET_WORK_REDIRECTS" + uppercase_data_type: "VEC" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_WORK_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_WORK_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_WORK_REDIRECTS" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_work_redirects" + uppercase_operation_id: "GET_WORK_REDIRECTS" + path: "/work/:id/redirects" + HttpMethod: "Get" + httpmethod: "get" /work/{id}/releases: get: tags: @@ -2512,6 +3624,115 @@ paths: path: "/work/:id/releases" HttpMethod: "Get" httpmethod: "get" + /work/edit/{edit_id}: + get: + tags: + - "works" + operationId: "get_work_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Found Edit" + schema: + $ref: "#/definitions/entity_edit" + x-responseId: "FoundEdit" + x-uppercaseResponseId: "FOUND_EDIT" + uppercase_operation_id: "GET_WORK_EDIT" + uppercase_data_type: "ENTITYEDIT" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "GET_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "GET_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "GET_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "get_work_edit" + uppercase_operation_id: "GET_WORK_EDIT" + path: "/work/edit/:edit_id" + HttpMethod: "Get" + httpmethod: "get" + delete: + tags: + - "works" + operationId: "delete_work_edit" + parameters: + - name: "edit_id" + in: "path" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "Deleted Edit" + schema: + $ref: "#/definitions/success" + x-responseId: "DeletedEdit" + x-uppercaseResponseId: "DELETED_EDIT" + uppercase_operation_id: "DELETE_WORK_EDIT" + uppercase_data_type: "SUCCESS" + producesJson: true + 400: + description: "Bad Request" + schema: + $ref: "#/definitions/error_response" + x-responseId: "BadRequest" + x-uppercaseResponseId: "BAD_REQUEST" + uppercase_operation_id: "DELETE_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 404: + description: "Not Found" + schema: + $ref: "#/definitions/error_response" + x-responseId: "NotFound" + x-uppercaseResponseId: "NOT_FOUND" + uppercase_operation_id: "DELETE_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + 500: + description: "Generic Error" + schema: + $ref: "#/definitions/error_response" + x-responseId: "GenericError" + x-uppercaseResponseId: "GENERIC_ERROR" + uppercase_operation_id: "DELETE_WORK_EDIT" + uppercase_data_type: "ERRORRESPONSE" + producesJson: true + operation_id: "delete_work_edit" + uppercase_operation_id: "DELETE_WORK_EDIT" + path: "/work/edit/:edit_id" + HttpMethod: "Delete" + httpmethod: "delete" /editor/{id}: get: operationId: "get_editor" @@ -2937,8 +4158,6 @@ definitions: upperCaseName: "SUCCESS" container_entity: type: "object" - required: - - "name" properties: coden: type: "string" @@ -2958,6 +4177,7 @@ definitions: name: type: "string" example: "Journal of Important Results" + description: "Required for valid entities" edit_extra: type: "object" extra: @@ -3006,8 +4226,6 @@ definitions: upperCaseName: "CONTAINER_ENTITY" creator_entity: type: "object" - required: - - "display_name" properties: wikidata_qid: type: "string" @@ -3024,6 +4242,7 @@ definitions: display_name: type: "string" example: "Grace Hopper" + description: "Required for valid entities" state: type: "string" enum: @@ -3086,12 +4305,12 @@ definitions: sha256: type: "string" example: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832" - md5: - type: "string" - example: "d41efcc592d1e40ac13905377399eb9b" sha1: type: "string" example: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8" + md5: + type: "string" + example: "d41efcc592d1e40ac13905377399eb9b" size: type: "integer" format: "int64" @@ -3151,8 +4370,6 @@ definitions: upperCaseName: "FILE_ENTITY" release_entity: type: "object" - required: - - "title" properties: abstracts: type: "array" @@ -3216,6 +4433,7 @@ definitions: example: "q3nouwy3nnbsvo3h5klxsx4a7y" title: type: "string" + description: "Required for valid entities" state: type: "string" enum: -- cgit v1.2.3