From 206acf1b37a1a34d5338c744e17ef2035cd2db58 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 24 Jan 2019 13:23:13 -0800 Subject: codegen schema tweaks --- .../fatcat_client/models/release_contrib.py | 8 ++++ rust/fatcat-api-spec/README.md | 2 +- rust/fatcat-api-spec/api.yaml | 24 ++++------- rust/fatcat-api-spec/api/swagger.yaml | 46 ++++++++++++++++++++-- rust/fatcat-api-spec/src/models.rs | 1 + 5 files changed, 61 insertions(+), 20 deletions(-) diff --git a/python_client/fatcat_client/models/release_contrib.py b/python_client/fatcat_client/models/release_contrib.py index e823e43e..3c4a4f71 100644 --- a/python_client/fatcat_client/models/release_contrib.py +++ b/python_client/fatcat_client/models/release_contrib.py @@ -104,6 +104,7 @@ class ReleaseContrib(object): def creator_id(self): """Gets the creator_id of this ReleaseContrib. # noqa: E501 + base32-encoded unique identifier # noqa: E501 :return: The creator_id of this ReleaseContrib. # noqa: E501 :rtype: str @@ -114,10 +115,17 @@ class ReleaseContrib(object): def creator_id(self, creator_id): """Sets the creator_id of this ReleaseContrib. + base32-encoded unique identifier # noqa: E501 :param creator_id: The creator_id of this ReleaseContrib. # noqa: E501 :type: str """ + if creator_id is not None and len(creator_id) > 26: + raise ValueError("Invalid value for `creator_id`, length must be less than or equal to `26`") # noqa: E501 + if creator_id is not None and len(creator_id) < 26: + raise ValueError("Invalid value for `creator_id`, length must be greater than or equal to `26`") # noqa: E501 + if creator_id is not None and not re.search('[a-zA-Z2-7]{26}', creator_id): # noqa: E501 + raise ValueError("Invalid value for `creator_id`, must be a follow pattern or equal to `/[a-zA-Z2-7]{26}/`") # noqa: E501 self._creator_id = creator_id diff --git a/rust/fatcat-api-spec/README.md b/rust/fatcat-api-spec/README.md index cacded6a..9d06dd4a 100644 --- a/rust/fatcat-api-spec/README.md +++ b/rust/fatcat-api-spec/README.md @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 0.1.0 -- Build date: 2019-01-23T05:30:23.378Z +- Build date: 2019-01-24T21:18:57.859Z This autogenerated project defines an API crate `fatcat` which contains: * An `Api` trait defining the API in Rust. diff --git a/rust/fatcat-api-spec/api.yaml b/rust/fatcat-api-spec/api.yaml index 14b70c39..e359de36 100644 --- a/rust/fatcat-api-spec/api.yaml +++ b/rust/fatcat-api-spec/api.yaml @@ -597,8 +597,7 @@ definitions: type: integer format: int64 creator_id: - type: string - #format: ident + <<: *FATCATIDENT creator: $ref: "#/definitions/creator_entity" description: "Optional; GET-only" @@ -866,8 +865,7 @@ paths: schema: type: array items: - type: string - #format: ident + <<: *FATCATIDENT <<: *ENTITYRESPONSES /container/lookup: get: @@ -1155,8 +1153,7 @@ paths: schema: type: array items: - type: string - #format: ident + <<: *FATCATIDENT <<: *ENTITYRESPONSES /creator/lookup: get: @@ -1421,8 +1418,7 @@ paths: schema: type: array items: - type: string - #format: ident + <<: *FATCATIDENT <<: *ENTITYRESPONSES /file/lookup: get: @@ -1692,8 +1688,7 @@ paths: schema: type: array items: - type: string - #format: ident + <<: *FATCATIDENT <<: *ENTITYRESPONSES /fileset/edit/{edit_id}: get: @@ -1929,8 +1924,7 @@ paths: schema: type: array items: - type: string - #format: ident + <<: *FATCATIDENT <<: *ENTITYRESPONSES /webcapture/edit/{edit_id}: get: @@ -2235,8 +2229,7 @@ paths: schema: type: array items: - type: string - #format: ident + <<: *FATCATIDENT <<: *ENTITYRESPONSES /release/lookup: get: @@ -2526,8 +2519,7 @@ paths: schema: type: array items: - type: string - #format: ident + <<: *FATCATIDENT <<: *ENTITYRESPONSES /work/{ident}/releases: parameters: diff --git a/rust/fatcat-api-spec/api/swagger.yaml b/rust/fatcat-api-spec/api/swagger.yaml index 927bb941..b671f676 100644 --- a/rust/fatcat-api-spec/api/swagger.yaml +++ b/rust/fatcat-api-spec/api/swagger.yaml @@ -629,6 +629,11 @@ paths: type: "array" items: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" x-responseId: "FoundEntityRedirects" x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" uppercase_operation_id: "GET_CONTAINER_REDIRECTS" @@ -1551,6 +1556,11 @@ paths: type: "array" items: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" x-responseId: "FoundEntityRedirects" x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" uppercase_operation_id: "GET_CREATOR_REDIRECTS" @@ -2409,6 +2419,11 @@ paths: type: "array" items: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" x-responseId: "FoundEntityRedirects" x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" uppercase_operation_id: "GET_FILE_REDIRECTS" @@ -3280,6 +3295,11 @@ paths: type: "array" items: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" x-responseId: "FoundEntityRedirects" x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" uppercase_operation_id: "GET_FILESET_REDIRECTS" @@ -4061,6 +4081,11 @@ paths: type: "array" items: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" x-responseId: "FoundEntityRedirects" x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" uppercase_operation_id: "GET_WEBCAPTURE_REDIRECTS" @@ -5034,6 +5059,11 @@ paths: type: "array" items: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" x-responseId: "FoundEntityRedirects" x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" uppercase_operation_id: "GET_RELEASE_REDIRECTS" @@ -5926,6 +5956,11 @@ paths: type: "array" items: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" x-responseId: "FoundEntityRedirects" x-uppercaseResponseId: "FOUND_ENTITY_REDIRECTS" uppercase_operation_id: "GET_WORK_REDIRECTS" @@ -7988,7 +8023,7 @@ definitions: raw_name: "raw_name" role: "role" extra: "{}" - creator_id: "creator_id" + creator_id: "q3nouwy3nnbsvo3h5klxsx4a7y" index: 1 - raw_affiliation: "raw_affiliation" creator: @@ -8006,7 +8041,7 @@ definitions: raw_name: "raw_name" role: "role" extra: "{}" - creator_id: "creator_id" + creator_id: "q3nouwy3nnbsvo3h5klxsx4a7y" index: 1 pages: "pages" core_id: "core_id" @@ -9040,6 +9075,11 @@ definitions: format: "int64" creator_id: type: "string" + example: "q3nouwy3nnbsvo3h5klxsx4a7y" + description: "base32-encoded unique identifier" + minLength: 26 + maxLength: 26 + pattern: "[a-zA-Z2-7]{26}" creator: description: "Optional; GET-only" $ref: "#/definitions/creator_entity" @@ -9069,7 +9109,7 @@ definitions: raw_name: "raw_name" role: "role" extra: "{}" - creator_id: "creator_id" + creator_id: "q3nouwy3nnbsvo3h5klxsx4a7y" index: 1 upperCaseName: "RELEASE_CONTRIB" auth_oidc: diff --git a/rust/fatcat-api-spec/src/models.rs b/rust/fatcat-api-spec/src/models.rs index d6e6e07f..f1b657c2 100644 --- a/rust/fatcat-api-spec/src/models.rs +++ b/rust/fatcat-api-spec/src/models.rs @@ -692,6 +692,7 @@ pub struct ReleaseContrib { #[serde(skip_serializing_if = "Option::is_none")] pub index: Option, + /// base32-encoded unique identifier #[serde(rename = "creator_id")] #[serde(skip_serializing_if = "Option::is_none")] pub creator_id: Option, -- cgit v1.2.3