twitter-openapi-typescript-generated 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +7 -1
- package/README.md +2 -2
- package/dist/apis/DefaultApi.d.ts +1 -1
- package/dist/apis/DefaultApi.d.ts.map +1 -1
- package/dist/apis/DefaultApi.js +3 -6
- package/dist/apis/DefaultApi.js.map +1 -1
- package/dist/apis/PostApi.d.ts +6 -0
- package/dist/apis/PostApi.d.ts.map +1 -1
- package/dist/apis/PostApi.js +24 -6
- package/dist/apis/PostApi.js.map +1 -1
- package/dist/apis/TweetApi.d.ts +9 -9
- package/dist/apis/TweetApi.d.ts.map +1 -1
- package/dist/apis/TweetApi.js +27 -54
- package/dist/apis/TweetApi.js.map +1 -1
- package/dist/apis/UserApi.d.ts +1 -1
- package/dist/apis/UserApi.d.ts.map +1 -1
- package/dist/apis/UserApi.js +3 -6
- package/dist/apis/UserApi.js.map +1 -1
- package/dist/apis/UserListApi.d.ts +2 -2
- package/dist/apis/UserListApi.d.ts.map +1 -1
- package/dist/apis/UserListApi.js +6 -12
- package/dist/apis/UserListApi.js.map +1 -1
- package/dist/models/Entities.d.ts +3 -2
- package/dist/models/Entities.d.ts.map +1 -1
- package/dist/models/Entities.js +3 -2
- package/dist/models/Entities.js.map +1 -1
- package/dist/models/PostCreateRetweetRequest.d.ts +3 -3
- package/dist/models/PostCreateRetweetRequest.d.ts.map +1 -1
- package/dist/models/PostCreateRetweetRequest.js +3 -3
- package/dist/models/PostCreateRetweetRequest.js.map +1 -1
- package/dist/models/PostCreateRetweetRequestVariables.d.ts +38 -0
- package/dist/models/PostCreateRetweetRequestVariables.d.ts.map +1 -0
- package/dist/models/PostCreateRetweetRequestVariables.js +54 -0
- package/dist/models/PostCreateRetweetRequestVariables.js.map +1 -0
- package/dist/models/PostDeleteTweetRequest.d.ts +3 -3
- package/dist/models/PostDeleteTweetRequest.d.ts.map +1 -1
- package/dist/models/PostDeleteTweetRequest.js +3 -3
- package/dist/models/PostDeleteTweetRequest.js.map +1 -1
- package/dist/models/PostFavoriteTweetRequest.d.ts +3 -3
- package/dist/models/PostFavoriteTweetRequest.d.ts.map +1 -1
- package/dist/models/PostFavoriteTweetRequest.js +3 -3
- package/dist/models/PostFavoriteTweetRequest.js.map +1 -1
- package/dist/models/PostUnfavoriteTweetRequest.d.ts +3 -3
- package/dist/models/PostUnfavoriteTweetRequest.d.ts.map +1 -1
- package/dist/models/PostUnfavoriteTweetRequest.js +3 -3
- package/dist/models/PostUnfavoriteTweetRequest.js.map +1 -1
- package/dist/models/Tweet.d.ts +7 -0
- package/dist/models/Tweet.d.ts.map +1 -1
- package/dist/models/Tweet.js +3 -0
- package/dist/models/Tweet.js.map +1 -1
- package/dist/models/TweetCard.d.ts +39 -0
- package/dist/models/TweetCard.d.ts.map +1 -0
- package/dist/models/TweetCard.js +54 -0
- package/dist/models/TweetCard.js.map +1 -0
- package/dist/models/TweetCardLegacy.d.ts +45 -0
- package/dist/models/TweetCardLegacy.d.ts.map +1 -0
- package/dist/models/TweetCardLegacy.js +58 -0
- package/dist/models/TweetCardLegacy.js.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.d.ts +39 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.d.ts.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.js +55 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.js.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.d.ts +50 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.d.ts.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.js +58 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.js.map +1 -0
- package/dist/models/TweetLegacy.d.ts +7 -0
- package/dist/models/TweetLegacy.d.ts.map +1 -1
- package/dist/models/TweetLegacy.js +3 -0
- package/dist/models/TweetLegacy.js.map +1 -1
- package/dist/models/TweetLegacySelfThread.d.ts +32 -0
- package/dist/models/TweetLegacySelfThread.d.ts.map +1 -0
- package/dist/models/TweetLegacySelfThread.js +51 -0
- package/dist/models/TweetLegacySelfThread.js.map +1 -0
- package/dist/models/Url.d.ts +50 -0
- package/dist/models/Url.d.ts.map +1 -0
- package/dist/models/Url.js +60 -0
- package/dist/models/Url.js.map +1 -0
- package/dist/models/index.d.ts +7 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +7 -1
- package/dist/models/index.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/DefaultApi.ts +4 -8
- package/src/apis/PostApi.ts +36 -6
- package/src/apis/TweetApi.ts +36 -72
- package/src/apis/UserApi.ts +4 -8
- package/src/apis/UserListApi.ts +8 -16
- package/src/models/Entities.ts +10 -4
- package/src/models/PostCreateRetweetRequest.ts +9 -9
- package/src/models/{PostDeleteTweetRequestVariables.ts → PostCreateRetweetRequestVariables.ts} +10 -10
- package/src/models/PostDeleteTweetRequest.ts +9 -9
- package/src/models/PostFavoriteTweetRequest.ts +9 -9
- package/src/models/PostUnfavoriteTweetRequest.ts +9 -9
- package/src/models/Tweet.ts +14 -0
- package/src/models/TweetCard.ts +80 -0
- package/src/models/TweetCardLegacy.ts +91 -0
- package/src/models/TweetCardLegacyBindingValuesInner.ts +82 -0
- package/src/models/TweetCardLegacyBindingValuesInnerValue.ts +90 -0
- package/src/models/TweetLegacy.ts +14 -0
- package/src/models/TweetLegacySelfThread.ts +66 -0
- package/src/models/Url.ts +93 -0
- package/src/models/index.ts +7 -1
- package/tools/openapi-generator-config.yaml +2 -2
- package/tools/win/replace.py +20 -20
- package/twitter-openapi/README.md +4 -6
- package/twitter-openapi/dist/{test → compatible}/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/{typescript → compatible}/paths/bookmarks.yaml +5 -5
- package/twitter-openapi/dist/{test → compatible}/paths/follow.yaml +14 -14
- package/twitter-openapi/dist/{typescript → compatible}/paths/post.yaml +135 -93
- package/twitter-openapi/dist/{test → compatible}/paths/profile.yaml +5 -5
- package/twitter-openapi/dist/{typescript → compatible}/paths/timeline.yaml +25 -25
- package/twitter-openapi/dist/{test → compatible}/paths/tweet.yaml +5 -5
- package/twitter-openapi/dist/{test → compatible}/paths/user.yaml +5 -5
- package/twitter-openapi/dist/{test → compatible}/paths/usertweets.yaml +36 -36
- package/twitter-openapi/dist/compatible/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/{dart → compatible}/schemas/tweet.yaml +65 -0
- package/twitter-openapi/dist/docs/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/docs/paths/bookmarks.yaml +7 -56
- package/twitter-openapi/dist/docs/paths/follow.yaml +18 -116
- package/twitter-openapi/dist/docs/paths/post.yaml +124 -82
- package/twitter-openapi/dist/docs/paths/profile.yaml +7 -35
- package/twitter-openapi/dist/docs/paths/timeline.yaml +43 -192
- package/twitter-openapi/dist/docs/paths/tweet.yaml +7 -61
- package/twitter-openapi/dist/docs/paths/user.yaml +7 -41
- package/twitter-openapi/dist/docs/paths/usertweets.yaml +53 -263
- package/twitter-openapi/dist/docs/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/docs/schemas/tweet.yaml +65 -0
- package/twitter-openapi/src/openapi/paths/bookmarks.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/follow.yaml +2 -2
- package/twitter-openapi/src/openapi/paths/post.yaml +6 -6
- package/twitter-openapi/src/openapi/paths/profile.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/timeline.yaml +3 -3
- package/twitter-openapi/src/openapi/paths/tweet.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/user.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/usertweets.yaml +4 -4
- package/twitter-openapi/src/openapi/resources/parameters.yaml +15 -0
- package/twitter-openapi/src/openapi/schemas/tweet.yaml +66 -1
- package/twitter-openapi/tools/__pycache__/build_config.cpython-310.pyc +0 -0
- package/twitter-openapi/tools/__pycache__/hooks.cpython-310.pyc +0 -0
- package/twitter-openapi/tools/build_config.py +67 -190
- package/twitter-openapi/tools/hooks.py +58 -13
- package/dist/models/PostDeleteTweetRequestVariables.d.ts +0 -38
- package/dist/models/PostDeleteTweetRequestVariables.d.ts.map +0 -1
- package/dist/models/PostDeleteTweetRequestVariables.js +0 -54
- package/dist/models/PostDeleteTweetRequestVariables.js.map +0 -1
- package/twitter-openapi/dist/dart/openapi-3.0.yaml +0 -117
- package/twitter-openapi/dist/dart/paths/bookmarks.yaml +0 -134
- package/twitter-openapi/dist/dart/paths/follow.yaml +0 -262
- package/twitter-openapi/dist/dart/paths/post.yaml +0 -834
- package/twitter-openapi/dist/dart/paths/profile.yaml +0 -152
- package/twitter-openapi/dist/dart/paths/timeline.yaml +0 -380
- package/twitter-openapi/dist/dart/paths/tweet.yaml +0 -134
- package/twitter-openapi/dist/dart/paths/user.yaml +0 -112
- package/twitter-openapi/dist/dart/paths/usertweets.yaml +0 -484
- package/twitter-openapi/dist/dart/paths/v1.1-get.yaml +0 -300
- package/twitter-openapi/dist/dart/paths/v1.1-post.yaml +0 -295
- package/twitter-openapi/dist/dart/paths/v2.0-get.yaml +0 -331
- package/twitter-openapi/dist/test/paths/bookmarks.yaml +0 -105
- package/twitter-openapi/dist/test/paths/other.yaml +0 -96
- package/twitter-openapi/dist/test/paths/post.yaml +0 -485
- package/twitter-openapi/dist/test/paths/timeline.yaml +0 -293
- package/twitter-openapi/dist/test/paths/v1.1-get.yaml +0 -242
- package/twitter-openapi/dist/test/paths/v1.1-post.yaml +0 -277
- package/twitter-openapi/dist/test/paths/v2.0-get.yaml +0 -302
- package/twitter-openapi/dist/test/response/error.yaml +0 -90
- package/twitter-openapi/dist/test/schemas/content.yaml +0 -181
- package/twitter-openapi/dist/test/schemas/general.yaml +0 -13
- package/twitter-openapi/dist/test/schemas/instruction.yaml +0 -83
- package/twitter-openapi/dist/test/schemas/timeline.yaml +0 -25
- package/twitter-openapi/dist/test/schemas/tweet.yaml +0 -251
- package/twitter-openapi/dist/test/schemas/typename.yaml +0 -19
- package/twitter-openapi/dist/test/schemas/user.yaml +0 -206
- package/twitter-openapi/dist/typescript/openapi-3.0.yaml +0 -141
- package/twitter-openapi/dist/typescript/paths/follow.yaml +0 -204
- package/twitter-openapi/dist/typescript/paths/other.yaml +0 -96
- package/twitter-openapi/dist/typescript/paths/profile.yaml +0 -123
- package/twitter-openapi/dist/typescript/paths/tweet.yaml +0 -105
- package/twitter-openapi/dist/typescript/paths/user.yaml +0 -83
- package/twitter-openapi/dist/typescript/paths/usertweets.yaml +0 -368
- package/twitter-openapi/dist/typescript/response/error.yaml +0 -90
- package/twitter-openapi/dist/typescript/schemas/content.yaml +0 -181
- package/twitter-openapi/dist/typescript/schemas/general.yaml +0 -13
- package/twitter-openapi/dist/typescript/schemas/instruction.yaml +0 -83
- package/twitter-openapi/dist/typescript/schemas/timeline.yaml +0 -25
- package/twitter-openapi/dist/typescript/schemas/tweet.yaml +0 -251
- package/twitter-openapi/dist/typescript/schemas/typename.yaml +0 -19
- package/twitter-openapi/dist/typescript/schemas/user.yaml +0 -206
- /package/twitter-openapi/dist/{dart → compatible}/paths/other.yaml +0 -0
- /package/twitter-openapi/dist/{typescript → compatible}/paths/v1.1-get.yaml +0 -0
- /package/twitter-openapi/dist/{typescript → compatible}/paths/v1.1-post.yaml +0 -0
- /package/twitter-openapi/dist/{typescript → compatible}/paths/v2.0-get.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/response/error.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/content.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/general.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/instruction.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/timeline.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/typename.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/user.yaml +0 -0
|
@@ -4,7 +4,7 @@ info:
|
|
|
4
4
|
version: 0.0.1
|
|
5
5
|
|
|
6
6
|
paths:
|
|
7
|
-
/graphql/{
|
|
7
|
+
/graphql/{pathQueryId}/Following:
|
|
8
8
|
get:
|
|
9
9
|
operationId: getFollowing
|
|
10
10
|
description: get user list of following
|
|
@@ -18,7 +18,7 @@ paths:
|
|
|
18
18
|
tags:
|
|
19
19
|
- "user-list"
|
|
20
20
|
|
|
21
|
-
/graphql/{
|
|
21
|
+
/graphql/{pathQueryId}/Followers:
|
|
22
22
|
get:
|
|
23
23
|
operationId: getFollowers
|
|
24
24
|
description: get user list of followers
|
|
@@ -4,7 +4,7 @@ info:
|
|
|
4
4
|
version: 0.0.1
|
|
5
5
|
|
|
6
6
|
paths:
|
|
7
|
-
/graphql/{
|
|
7
|
+
/graphql/{pathQueryId}/FavoriteTweet:
|
|
8
8
|
post:
|
|
9
9
|
operationId: postFavoriteTweet
|
|
10
10
|
description: favorite Tweet
|
|
@@ -18,7 +18,7 @@ paths:
|
|
|
18
18
|
tags:
|
|
19
19
|
- "post"
|
|
20
20
|
|
|
21
|
-
/graphql/{
|
|
21
|
+
/graphql/{pathQueryId}/UnfavoriteTweet:
|
|
22
22
|
post:
|
|
23
23
|
operationId: postUnfavoriteTweet
|
|
24
24
|
description: unfavorite Tweet
|
|
@@ -32,7 +32,7 @@ paths:
|
|
|
32
32
|
tags:
|
|
33
33
|
- "post"
|
|
34
34
|
|
|
35
|
-
/graphql/{
|
|
35
|
+
/graphql/{pathQueryId}/CreateRetweet:
|
|
36
36
|
post:
|
|
37
37
|
operationId: postCreateRetweet
|
|
38
38
|
description: create Retweet
|
|
@@ -46,7 +46,7 @@ paths:
|
|
|
46
46
|
tags:
|
|
47
47
|
- "post"
|
|
48
48
|
|
|
49
|
-
/graphql/{
|
|
49
|
+
/graphql/{pathQueryId}/DeleteRetweet:
|
|
50
50
|
post:
|
|
51
51
|
operationId: postDeleteRetweet
|
|
52
52
|
description: delete Retweet
|
|
@@ -60,7 +60,7 @@ paths:
|
|
|
60
60
|
tags:
|
|
61
61
|
- "post"
|
|
62
62
|
|
|
63
|
-
/graphql/{
|
|
63
|
+
/graphql/{pathQueryId}/CreateTweet:
|
|
64
64
|
post:
|
|
65
65
|
operationId: postCreateTweet
|
|
66
66
|
description: create Tweet
|
|
@@ -74,7 +74,7 @@ paths:
|
|
|
74
74
|
tags:
|
|
75
75
|
- "post"
|
|
76
76
|
|
|
77
|
-
/graphql/{
|
|
77
|
+
/graphql/{pathQueryId}/DeleteTweet:
|
|
78
78
|
post:
|
|
79
79
|
operationId: postDeleteTweet
|
|
80
80
|
description: delete Retweet
|
|
@@ -4,7 +4,7 @@ info:
|
|
|
4
4
|
version: 0.0.1
|
|
5
5
|
|
|
6
6
|
paths:
|
|
7
|
-
/graphql/{
|
|
7
|
+
/graphql/{pathQueryId}/HomeTimeline:
|
|
8
8
|
get:
|
|
9
9
|
operationId: getHomeTimeline
|
|
10
10
|
description: get tweet list of timeline
|
|
@@ -18,7 +18,7 @@ paths:
|
|
|
18
18
|
tags:
|
|
19
19
|
- "tweet"
|
|
20
20
|
|
|
21
|
-
/graphql/{
|
|
21
|
+
/graphql/{pathQueryId}/HomeLatestTimeline:
|
|
22
22
|
get:
|
|
23
23
|
operationId: getHomeLatestTimeline
|
|
24
24
|
description: get tweet list of timeline
|
|
@@ -32,7 +32,7 @@ paths:
|
|
|
32
32
|
tags:
|
|
33
33
|
- "tweet"
|
|
34
34
|
|
|
35
|
-
/graphql/{
|
|
35
|
+
/graphql/{pathQueryId}/ListLatestTweetsTimeline:
|
|
36
36
|
get:
|
|
37
37
|
operationId: getListLatestTweetsTimeline
|
|
38
38
|
description: get tweet list of timeline
|
|
@@ -4,7 +4,7 @@ info:
|
|
|
4
4
|
version: 0.0.1
|
|
5
5
|
|
|
6
6
|
paths:
|
|
7
|
-
/graphql/{
|
|
7
|
+
/graphql/{pathQueryId}/UserTweets:
|
|
8
8
|
get:
|
|
9
9
|
operationId: getUserTweets
|
|
10
10
|
description: "get user tweets"
|
|
@@ -18,7 +18,7 @@ paths:
|
|
|
18
18
|
tags:
|
|
19
19
|
- "tweet"
|
|
20
20
|
|
|
21
|
-
/graphql/{
|
|
21
|
+
/graphql/{pathQueryId}/UserTweetsAndReplies:
|
|
22
22
|
get:
|
|
23
23
|
operationId: getUserTweetsAndReplies
|
|
24
24
|
description: "get user replies tweets"
|
|
@@ -32,7 +32,7 @@ paths:
|
|
|
32
32
|
tags:
|
|
33
33
|
- "tweet"
|
|
34
34
|
|
|
35
|
-
/graphql/{
|
|
35
|
+
/graphql/{pathQueryId}/UserMedia:
|
|
36
36
|
get:
|
|
37
37
|
operationId: getUserMedia
|
|
38
38
|
description: "get user media tweets"
|
|
@@ -46,7 +46,7 @@ paths:
|
|
|
46
46
|
tags:
|
|
47
47
|
- "tweet"
|
|
48
48
|
|
|
49
|
-
/graphql/{
|
|
49
|
+
/graphql/{pathQueryId}/Likes:
|
|
50
50
|
get:
|
|
51
51
|
operationId: getLikes
|
|
52
52
|
description: "get user likes tweets"
|
|
@@ -53,6 +53,45 @@ components:
|
|
|
53
53
|
pattern: "^[0-9]+$"
|
|
54
54
|
core:
|
|
55
55
|
$ref: "./user.yaml#/components/schemas/UserResultCore"
|
|
56
|
+
card:
|
|
57
|
+
type: object
|
|
58
|
+
properties:
|
|
59
|
+
rest_id:
|
|
60
|
+
type: string
|
|
61
|
+
legacy:
|
|
62
|
+
type: object
|
|
63
|
+
required:
|
|
64
|
+
- "binding_values"
|
|
65
|
+
- "name"
|
|
66
|
+
- "url"
|
|
67
|
+
properties:
|
|
68
|
+
name:
|
|
69
|
+
type: string
|
|
70
|
+
url:
|
|
71
|
+
type: string
|
|
72
|
+
binding_values:
|
|
73
|
+
type: array
|
|
74
|
+
items:
|
|
75
|
+
type: object
|
|
76
|
+
required:
|
|
77
|
+
- "key"
|
|
78
|
+
- "value"
|
|
79
|
+
properties:
|
|
80
|
+
key:
|
|
81
|
+
type: string
|
|
82
|
+
value:
|
|
83
|
+
type: object
|
|
84
|
+
required:
|
|
85
|
+
- "type"
|
|
86
|
+
properties:
|
|
87
|
+
string_value:
|
|
88
|
+
type: string
|
|
89
|
+
boolean_value:
|
|
90
|
+
type: boolean
|
|
91
|
+
scribe_key:
|
|
92
|
+
type: string
|
|
93
|
+
type:
|
|
94
|
+
type: string
|
|
56
95
|
unmention_data:
|
|
57
96
|
type: object # todo
|
|
58
97
|
edit_control:
|
|
@@ -161,6 +200,14 @@ components:
|
|
|
161
200
|
id_str:
|
|
162
201
|
type: string
|
|
163
202
|
pattern: "^[0-9]+$"
|
|
203
|
+
self_thread:
|
|
204
|
+
type: object
|
|
205
|
+
required:
|
|
206
|
+
- "id_str"
|
|
207
|
+
properties:
|
|
208
|
+
id_str:
|
|
209
|
+
type: string
|
|
210
|
+
pattern: "^[0-9]+$"
|
|
164
211
|
extended_entities:
|
|
165
212
|
$ref: "#/components/schemas/ExtendedEntities"
|
|
166
213
|
|
|
@@ -200,7 +247,25 @@ components:
|
|
|
200
247
|
UserMention:
|
|
201
248
|
type: object # todo
|
|
202
249
|
Url:
|
|
203
|
-
type: object
|
|
250
|
+
type: object
|
|
251
|
+
required:
|
|
252
|
+
- "url"
|
|
253
|
+
- "indices"
|
|
254
|
+
- "expanded_url"
|
|
255
|
+
- "display_url"
|
|
256
|
+
properties:
|
|
257
|
+
display_url:
|
|
258
|
+
type: string
|
|
259
|
+
expanded_url:
|
|
260
|
+
type: string
|
|
261
|
+
format: uri
|
|
262
|
+
url:
|
|
263
|
+
type: string
|
|
264
|
+
format: uri
|
|
265
|
+
indices:
|
|
266
|
+
type: array
|
|
267
|
+
items:
|
|
268
|
+
type: integer
|
|
204
269
|
|
|
205
270
|
ExtendedEntities:
|
|
206
271
|
required:
|
|
Binary file
|
|
Binary file
|
|
@@ -5,196 +5,73 @@ class Config:
|
|
|
5
5
|
OUTPUT_DIR = "dist/{0}"
|
|
6
6
|
INPUT_DIR = "src/openapi"
|
|
7
7
|
|
|
8
|
+
def hooks_generator(self, queryParameterJson=True):
|
|
9
|
+
# https://stackoverflow.com/questions/34820064/defining-an-api-with-swagger-get-call-that-uses-json-in-parameters/45223964
|
|
10
|
+
if queryParameterJson:
|
|
11
|
+
getParamHook = AddParametersOnContent(
|
|
12
|
+
split=-1,
|
|
13
|
+
contentType="application/json",
|
|
14
|
+
ignoreKeys=["queryId"],
|
|
15
|
+
)
|
|
16
|
+
postParamHook = AddParametersOnParameters(
|
|
17
|
+
split=-1,
|
|
18
|
+
schemaType=None,
|
|
19
|
+
)
|
|
20
|
+
else:
|
|
21
|
+
getParamHook = AddParametersOnParameters(
|
|
22
|
+
split=-1,
|
|
23
|
+
schemaType="string",
|
|
24
|
+
ignoreKeys=["queryId"],
|
|
25
|
+
)
|
|
26
|
+
postParamHook = AddParametersOnBody(
|
|
27
|
+
split=-1,
|
|
28
|
+
schemaType=None,
|
|
29
|
+
contentType="application/json",
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
"openapi": [AddSecuritySchemesOnSecuritySchemes()],
|
|
34
|
+
"schemas": [],
|
|
35
|
+
"other": [],
|
|
36
|
+
"request": {
|
|
37
|
+
key: [
|
|
38
|
+
SetResponsesHeader(suffix=None),
|
|
39
|
+
AddPathQueryIdOnParameters(split=-1),
|
|
40
|
+
getParamHook,
|
|
41
|
+
]
|
|
42
|
+
for key in ["default", "user", "user-list", "tweet"]
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
key: [
|
|
46
|
+
SetResponsesHeader(suffix=None),
|
|
47
|
+
AddPathQueryIdOnParameters(split=-1),
|
|
48
|
+
postParamHook,
|
|
49
|
+
]
|
|
50
|
+
for key in ["post"]
|
|
51
|
+
}
|
|
52
|
+
| {
|
|
53
|
+
key: [
|
|
54
|
+
SetResponsesHeader(suffix="legacy"),
|
|
55
|
+
AddParametersOnParameters(split=2, schemaType=None),
|
|
56
|
+
]
|
|
57
|
+
for key in ["v1.1-get", "v2.0-get"]
|
|
58
|
+
}
|
|
59
|
+
| {
|
|
60
|
+
key: [
|
|
61
|
+
SetResponsesHeader(suffix="legacy"),
|
|
62
|
+
AddParametersOnBody(
|
|
63
|
+
split=2,
|
|
64
|
+
schemaType=None,
|
|
65
|
+
contentType="application/x-www-form-urlencoded",
|
|
66
|
+
),
|
|
67
|
+
]
|
|
68
|
+
for key in ["v1.1-post", "v2.0-post"]
|
|
69
|
+
}
|
|
70
|
+
| {"other": []},
|
|
71
|
+
}
|
|
72
|
+
|
|
8
73
|
def main(self):
|
|
9
74
|
return {
|
|
10
|
-
"docs":
|
|
11
|
-
|
|
12
|
-
"schemas": [],
|
|
13
|
-
"other":[],
|
|
14
|
-
"request": {
|
|
15
|
-
key: [
|
|
16
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
17
|
-
SetResponsesHeader(suffix=None),
|
|
18
|
-
AddParametersOnContent(
|
|
19
|
-
split=-1, contentType="application/json"
|
|
20
|
-
),
|
|
21
|
-
]
|
|
22
|
-
for key in ["default", "user", "user-list", "tweet"]
|
|
23
|
-
}
|
|
24
|
-
| {
|
|
25
|
-
key: [
|
|
26
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
27
|
-
SetResponsesHeader(suffix=None),
|
|
28
|
-
AddParametersOnParameters(
|
|
29
|
-
split=-1,
|
|
30
|
-
schemaType=None,
|
|
31
|
-
),
|
|
32
|
-
]
|
|
33
|
-
for key in ["post"]
|
|
34
|
-
}
|
|
35
|
-
| {
|
|
36
|
-
key: [
|
|
37
|
-
SetResponsesHeader(suffix="legacy"),
|
|
38
|
-
AddParametersOnParameters(
|
|
39
|
-
split=2,
|
|
40
|
-
schemaType=None,
|
|
41
|
-
),
|
|
42
|
-
]
|
|
43
|
-
for key in ["v1.1-get", "v2.0-get"]
|
|
44
|
-
}
|
|
45
|
-
| {
|
|
46
|
-
key: [
|
|
47
|
-
SetResponsesHeader(suffix="legacy"),
|
|
48
|
-
AddParametersOnBody(
|
|
49
|
-
split=2,
|
|
50
|
-
schemaType=None,
|
|
51
|
-
contentType="application/x-www-form-urlencoded",
|
|
52
|
-
),
|
|
53
|
-
]
|
|
54
|
-
for key in ["v1.1-post", "v2.0-post"]
|
|
55
|
-
}
|
|
56
|
-
| {"other": []},
|
|
57
|
-
},
|
|
58
|
-
"dart": {
|
|
59
|
-
"openapi": [],
|
|
60
|
-
"schemas": [],
|
|
61
|
-
"other":[],
|
|
62
|
-
"request": {
|
|
63
|
-
key: [
|
|
64
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
65
|
-
AddSecuritySchemesOnHeader(split=-1),
|
|
66
|
-
SetResponsesHeader(suffix=None),
|
|
67
|
-
AddParametersOnParameters(
|
|
68
|
-
split=-1,
|
|
69
|
-
schemaType="string",
|
|
70
|
-
),
|
|
71
|
-
]
|
|
72
|
-
for key in ["default", "user", "user-list", "tweet"]
|
|
73
|
-
}
|
|
74
|
-
| {
|
|
75
|
-
key: [
|
|
76
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
77
|
-
AddSecuritySchemesOnHeader(split=-1),
|
|
78
|
-
SetResponsesHeader(suffix=None),
|
|
79
|
-
AddParametersOnBody(
|
|
80
|
-
split=-1,
|
|
81
|
-
schemaType=None,
|
|
82
|
-
contentType="application/json",
|
|
83
|
-
),
|
|
84
|
-
]
|
|
85
|
-
for key in ["post"]
|
|
86
|
-
}
|
|
87
|
-
| {
|
|
88
|
-
key: [
|
|
89
|
-
SetResponsesHeader(suffix="legacy"),
|
|
90
|
-
AddSecuritySchemesOnHeader(split=-1),
|
|
91
|
-
AddParametersOnParameters(
|
|
92
|
-
split=2,
|
|
93
|
-
schemaType=None,
|
|
94
|
-
),
|
|
95
|
-
]
|
|
96
|
-
for key in ["v1.1-get", "v2.0-get"]
|
|
97
|
-
}
|
|
98
|
-
| {
|
|
99
|
-
key: [
|
|
100
|
-
SetResponsesHeader(suffix="legacy"),
|
|
101
|
-
AddSecuritySchemesOnHeader(split=-1),
|
|
102
|
-
AddParametersOnBody(
|
|
103
|
-
split=2,
|
|
104
|
-
schemaType=None,
|
|
105
|
-
contentType="application/x-www-form-urlencoded",
|
|
106
|
-
),
|
|
107
|
-
]
|
|
108
|
-
for key in ["v1.1-post", "v2.0-post"]
|
|
109
|
-
}
|
|
110
|
-
| {"other": []},
|
|
111
|
-
},
|
|
112
|
-
"typescript": {
|
|
113
|
-
"openapi": [AddSecuritySchemesOnSecuritySchemes()],
|
|
114
|
-
"schemas": [],
|
|
115
|
-
"other":[],
|
|
116
|
-
"request": {
|
|
117
|
-
key: [
|
|
118
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
119
|
-
SetResponsesHeader(suffix=None),
|
|
120
|
-
AddParametersOnParameters(
|
|
121
|
-
split=-1,
|
|
122
|
-
schemaType="string",
|
|
123
|
-
),
|
|
124
|
-
]
|
|
125
|
-
for key in ["default", "user", "user-list", "tweet"]
|
|
126
|
-
}
|
|
127
|
-
| {
|
|
128
|
-
key: [
|
|
129
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
130
|
-
SetResponsesHeader(suffix=None),
|
|
131
|
-
AddParametersOnBody(
|
|
132
|
-
split=-1,
|
|
133
|
-
schemaType=None,
|
|
134
|
-
contentType="application/json",
|
|
135
|
-
),
|
|
136
|
-
]
|
|
137
|
-
for key in ["post"]
|
|
138
|
-
}
|
|
139
|
-
| {
|
|
140
|
-
key: [
|
|
141
|
-
SetResponsesHeader(suffix="legacy"),
|
|
142
|
-
AddParametersOnParameters(
|
|
143
|
-
split=2,
|
|
144
|
-
schemaType=None,
|
|
145
|
-
),
|
|
146
|
-
]
|
|
147
|
-
for key in ["v1.1-get", "v2.0-get"]
|
|
148
|
-
}
|
|
149
|
-
| {
|
|
150
|
-
key: [
|
|
151
|
-
SetResponsesHeader(suffix="legacy"),
|
|
152
|
-
AddParametersOnBody(
|
|
153
|
-
split=2,
|
|
154
|
-
schemaType=None,
|
|
155
|
-
contentType="application/x-www-form-urlencoded",
|
|
156
|
-
),
|
|
157
|
-
]
|
|
158
|
-
for key in ["v1.1-post", "v2.0-post"]
|
|
159
|
-
}
|
|
160
|
-
| {"other": []},
|
|
161
|
-
},
|
|
162
|
-
"test": {
|
|
163
|
-
"openapi": [AddSecuritySchemesOnSecuritySchemes()],
|
|
164
|
-
"schemas": [],
|
|
165
|
-
"other":[],
|
|
166
|
-
"request": {
|
|
167
|
-
key: [
|
|
168
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
169
|
-
SetResponsesHeader(suffix=None),
|
|
170
|
-
AddParametersOnParameters(
|
|
171
|
-
split=-1,
|
|
172
|
-
schemaType="string",
|
|
173
|
-
),
|
|
174
|
-
]
|
|
175
|
-
for key in ["default", "user", "user-list", "tweet"]
|
|
176
|
-
}
|
|
177
|
-
| {
|
|
178
|
-
key: [
|
|
179
|
-
ReplaceQueryIdPlaceholder(split=-1),
|
|
180
|
-
SetResponsesHeader(suffix=None),
|
|
181
|
-
AddParametersOnParameters(
|
|
182
|
-
split=-1,
|
|
183
|
-
schemaType="string",
|
|
184
|
-
),
|
|
185
|
-
]
|
|
186
|
-
for key in ["post"]
|
|
187
|
-
}
|
|
188
|
-
| {
|
|
189
|
-
key: [
|
|
190
|
-
SetResponsesHeader(suffix="legacy"),
|
|
191
|
-
AddParametersOnParameters(
|
|
192
|
-
split=2,
|
|
193
|
-
schemaType="object",
|
|
194
|
-
),
|
|
195
|
-
]
|
|
196
|
-
for key in ["v1.1-get", "v1.1-post", "v2.0-get", "v2.0-post"]
|
|
197
|
-
}
|
|
198
|
-
| {"other": []},
|
|
199
|
-
},
|
|
75
|
+
"docs": self.hooks_generator(),
|
|
76
|
+
"compatible": self.hooks_generator(queryParameterJson=False),
|
|
200
77
|
}
|