diff --git a/dist/compatible/openapi-3.0.yaml b/dist/compatible/openapi-3.0.yaml index d62894e..aeb9960 100644 --- a/dist/compatible/openapi-3.0.yaml +++ b/dist/compatible/openapi-3.0.yaml @@ -780,6 +780,8 @@ components: type: object Errors: properties: + data: + $ref: '#/components/schemas/ErrorsData' errors: items: $ref: '#/components/schemas/Error' @@ -787,6 +789,12 @@ components: required: - errors type: object + ErrorsData: + properties: + user: + pattern: dummy + type: string + type: object ExtMediaAvailability: properties: reason: @@ -6578,8 +6586,7 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OtherResponse' + $ref: '#/components/schemas/OtherResponse' description: Successful operation tags: - other diff --git a/dist/compatible_discriminator/openapi-3.0.yaml b/dist/compatible_discriminator/openapi-3.0.yaml index fde043a..b0f6efe 100644 --- a/dist/compatible_discriminator/openapi-3.0.yaml +++ b/dist/compatible_discriminator/openapi-3.0.yaml @@ -780,6 +780,8 @@ components: type: object Errors: properties: + data: + $ref: '#/components/schemas/ErrorsData' errors: items: $ref: '#/components/schemas/Error' @@ -787,6 +789,12 @@ components: required: - errors type: object + ErrorsData: + properties: + user: + pattern: dummy + type: string + type: object ExtMediaAvailability: properties: reason: @@ -6520,8 +6528,7 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OtherResponse' + $ref: '#/components/schemas/OtherResponse' description: Successful operation tags: - other diff --git a/dist/docs/openapi-3.0.yaml b/dist/docs/openapi-3.0.yaml index 2af419f..8c6ddc3 100644 --- a/dist/docs/openapi-3.0.yaml +++ b/dist/docs/openapi-3.0.yaml @@ -780,6 +780,8 @@ components: type: object Errors: properties: + data: + $ref: '#/components/schemas/ErrorsData' errors: items: $ref: '#/components/schemas/Error' @@ -787,6 +789,12 @@ components: required: - errors type: object + ErrorsData: + properties: + user: + pattern: dummy + type: string + type: object ExtMediaAvailability: properties: reason: @@ -8687,8 +8695,7 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OtherResponse' + $ref: '#/components/schemas/OtherResponse' description: Successful operation tags: - other diff --git a/src/openapi/paths/other.yaml b/src/openapi/paths/other.yaml index 7bab3ec..40820dd 100644 --- a/src/openapi/paths/other.yaml +++ b/src/openapi/paths/other.yaml @@ -14,8 +14,7 @@ paths: content: application/json: schema: - oneOf: - - $ref: "#/components/schemas/OtherResponse" + $ref: "#/components/schemas/OtherResponse" tags: - "other" diff --git a/src/openapi/response/error.yaml b/src/openapi/response/error.yaml index 7006c7a..a37f631 100644 --- a/src/openapi/response/error.yaml +++ b/src/openapi/response/error.yaml @@ -15,6 +15,15 @@ components: type: array items: $ref: "#/components/schemas/Error" + data: + $ref: "#/components/schemas/ErrorsData" + + ErrorsData: + type: object + properties: + user: + type: string # always null + pattern: "dummy" Error: type: object diff --git a/test/python/test_serialize_guest.py b/test/python/test_serialize_guest.py index 5079922..21a1fe6 100644 --- a/test/python/test_serialize_guest.py +++ b/test/python/test_serialize_guest.py @@ -2,6 +2,7 @@ import json from pathlib import Path import openapi_client as pt +import urllib3 def get_kwargs(key, additional): @@ -33,9 +34,17 @@ if __name__ == "__main__": "GuestToken": cookies["gt"], }, ) + + latest_user_agent_res = urllib3.PoolManager().request( + "GET", + "https://raw.githubusercontent.com/fa0311/latest-user-agent/main/output.json", + ) + + latest_user_agent = json.loads(latest_user_agent_res.data.decode("utf-8")) + api_conf.access_token = "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA" api_client = pt.ApiClient(configuration=api_conf, cookie=cookies_str) - api_client.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" + api_client.user_agent = latest_user_agent["chrome-fetch"] pt.TweetApi(api_client).get_user_tweets_with_http_info( **get_kwargs("UserTweets", {}),