1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 23:50:26 +01:00
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-04-27 20:18:39 +09:00
parent a69d2fa7d8
commit 5eedd4146d
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
6 changed files with 283 additions and 163 deletions

View file

@ -6,18 +6,6 @@ paths:
/parameters:
get:
parameters:
- name: variables
in: query
required: true
schema:
type: string
example: "{{Variables}}"
- name: features
in: query
required: true
schema:
type: string
example: "{{Features}}"
- name: queryId
in: query
required: true
@ -26,6 +14,45 @@ paths:
default: "{{Query}}"
example: "{{Query}}"
# {% if get_parameters == string %}
- name: variables
in: query
required: true
schema:
type: string
default: "{{Variables}}"
example: "{{Variables}}"
- name: features
in: query
required: true
schema:
type: string
default: "{{Features}}"
example: "{{Features}}"
# {% endif %}
# {% if get_parameters == object %}
- name: variables
in: query
required: true
schema:
type: object
- name: features
in: query
required: true
schema:
type: object
- name: queryId
in: query
required: true
schema:
type: object
# {% endif %}
# {% if header == parameters %}
- name: authorization
@ -58,62 +85,71 @@ paths:
description: "UserAgent, some APIs may be rejected if changed."
# {% endif %}
post:
parameters:
- name: variables
in: query
required: true
schema:
type: object
example: "{{Variables}}"
- name: features
in: query
required: true
schema:
type: object
example: "{{Features}}"
- name: queryId
in: query
required: true
schema:
type: string
default: "{{Query}}"
example: "{{Query}}"
# {% if header == parameters %}
- name: authorization
in: header
required: true
schema:
type: string
default: "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
description: "It is a constant value and does not need to be changed."
- name: x-twitter-active-user
in: header
required: true
schema:
type: string
default: "yes"
description: "Unknown what this value means."
- name: x-twitter-client-language
in: header
required: true
schema:
type: string
default: "en"
description: "language code."
- name: user-agent
in: header
required: true
schema:
type: string
default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
description: "UserAgent, some APIs may be rejected if changed."
# {% endif %}
responses:
"200":
description: ""
post:
# {% if header == parameters %}
parameters:
- name: authorization
in: header
required: true
schema:
type: string
default: "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
description: "It is a constant value and does not need to be changed."
- name: x-twitter-active-user
in: header
required: true
schema:
type: string
default: "yes"
description: "Unknown what this value means."
- name: x-twitter-client-language
in: header
required: true
schema:
type: string
default: "en"
description: "language code."
- name: user-agent
in: header
required: true
schema:
type: string
default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
description: "UserAgent, some APIs may be rejected if changed."
# {% endif %}
# {% if post_parameters == object %}
requestBody:
required: true
content:
application/json:
schema:
required:
- "queryId"
- "variables"
- "features"
properties:
queryId:
type: string
default: "{{Query}}"
example: "{{Query}}"
variables:
type: object
# default: "{{Variables}}"
example: "{{Variables}}"
features:
type: object
# default: "{{Features}}"
example: "{{Features}}"
# {% endif %}
responses:
"200":
description: ""

View file

@ -364,29 +364,25 @@
"Query": "lI07N6Otwv1PhnEgXILM7A",
"Variables": {
"tweet_id": "1349129669258448897"
},
"Features": {}
}
},
"UnfavoriteTweet": {
"Query": "ZYKSe-w7KEslx3JhSIk5LA",
"Variables": {
"tweet_id": "1349129669258448897"
},
"Features": {}
}
},
"CreateRetweet": {
"Query": "ojPdsZsimiJrUGLR1sjUtA",
"Variables": {
"tweet_id": "1349129669258448897"
},
"Features": {}
}
},
"DeleteRetweet": {
"Query": "iQtK4dl5hBmXewYZuEOKVw",
"Variables": {
"tweet_id": "1349129669258448897"
},
"Features": {}
}
},
"CreateTweet": {
"Query": "1RyAhNwby-gzGCRVsMxKbQ",
@ -396,7 +392,8 @@
"media_entities": [],
"possibly_sensitive": false
},
"semantic_annotation_ids": []
"semantic_annotation_ids": [],
"dark_request": false
},
"Features": {
"tweetypie_unmention_optimization_enabled": true,
@ -424,8 +421,7 @@
"Query": "VaenaVgh5q5ih7kvyVjgtg",
"Variables": {
"tweet_id": "1349129669258448897"
},
"Features": {}
}
},
"Template": {
"Query": "",

View file

@ -1,8 +1,17 @@
{
"dart": {
"header": "parameters"
"header": "parameters",
"get_parameters": "string",
"post_parameters": "object"
},
"typescript": {
"header": "securitySchemes"
"header": "securitySchemes",
"get_parameters": "string",
"post_parameters": "object"
},
"test": {
"header": "securitySchemes",
"get_parameters": "string",
"post_parameters": "string"
}
}

View file

@ -6,7 +6,7 @@ info:
paths:
/{{FavoriteTweetQuery}}/FavoriteTweet:
post:
operationId: favoriteTweet
operationId: postFavoriteTweet
description: favorite Tweet
responses:
"200":
@ -20,7 +20,7 @@ paths:
/{{UnfavoriteTweetQuery}}/UnfavoriteTweet:
post:
operationId: unfavoriteTweet
operationId: postUnfavoriteTweet
description: unfavorite Tweet
responses:
"200":
@ -34,7 +34,7 @@ paths:
/{{CreateRetweetQuery}}/CreateRetweet:
post:
operationId: createRetweet
operationId: postCreateRetweet
description: create Retweet
responses:
"200":
@ -48,7 +48,7 @@ paths:
/{{DeleteRetweetQuery}}/DeleteRetweet:
post:
operationId: deleteRetweet
operationId: postDeleteRetweet
description: delete Retweet
responses:
"200":
@ -62,7 +62,7 @@ paths:
/{{CreateTweetQuery}}/CreateTweet:
post:
operationId: createTweet
operationId: postCreateTweet
description: create Tweet
responses:
"200":
@ -76,7 +76,7 @@ paths:
/{{DeleteTweetQuery}}/DeleteTweet:
post:
operationId: deleteTweet
operationId: postDeleteTweet
description: delete Retweet
responses:
"200":
@ -95,14 +95,28 @@ components:
- "data"
properties:
data:
$ref: "./../schemas/post.yaml#/components/schemas/FavoriteTweet"
$ref: "#/components/schemas/FavoriteTweet"
FavoriteTweet:
required:
- "favorite_tweet"
properties:
favorite_tweet:
type: string
UnfavoriteTweetResponseData:
required:
- "data"
properties:
data:
$ref: "./../schemas/post.yaml#/components/schemas/UnfavoriteTweet"
$ref: "#/components/schemas/UnfavoriteTweet"
UnfavoriteTweet:
required:
- "unfavorite_tweet"
properties:
unfavorite_tweet:
type: string
# ---Retweet---
@ -125,7 +139,30 @@ components:
- "retweet_results"
properties:
retweet_results:
$ref: "./../schemas/post.yaml#/components/schemas/CreateRetweet"
$ref: "#/components/schemas/CreateRetweet"
CreateRetweet:
required:
- "result"
properties:
result:
type: object
items:
$ref: "#/components/schemas/Retweet"
Retweet:
required:
- "rest_id"
- "legacy"
properties:
rest_id:
type: string
legacy:
type: object
items:
properties:
full_text:
type: string
DeleteRetweetResponse:
required:
@ -146,7 +183,16 @@ components:
- "source_tweet_results"
properties:
retweet_results:
$ref: "./../schemas/post.yaml#/components/schemas/DeleteRetweet"
$ref: "#/components/schemas/DeleteRetweet"
DeleteRetweet:
required:
- "result"
properties:
result:
type: object
items:
$ref: "#/components/schemas/Retweet"
# ---Tweet---
@ -169,7 +215,14 @@ components:
- "tweet_results"
properties:
tweet_results:
$ref: "./../schemas/post.yaml#/components/schemas/CreateTweet"
$ref: "#/components/schemas/CreateTweet"
CreateTweet:
required:
- "result"
properties:
result:
$ref: "./../schemas/tweet.yaml#/components/schemas/Tweet"
DeleteTweetResponse:
required:

View file

@ -0,0 +1,97 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
ErrorResponse:
type: object
required:
- errors
- data
properties:
errors:
$ref: "#/components/schemas/Errors"
Errors:
type: array
items:
$ref: "#/components/schemas/Error"
Error:
type: object
required:
- message
- locations
- path
- extensions
- code
- kind
- name
- source
- tracing
properties:
message:
type: string
locations:
type: array
items:
$ref: "#/components/schemas/Location"
path:
type: array
items:
type: string
extensions:
$ref: "#/components/schemas/Extensions"
code:
type: integer
kind:
type: string
name:
type: string
source:
type: string
tracing:
$ref: "#/components/schemas/Tracing"
Location:
type: object
required:
- line
- column
properties:
line:
type: integer
column:
type: integer
Extensions:
type: object
required:
- name
- source
- code
- kind
- tracing
properties:
name:
type: string
source:
type: string
code:
type: integer
kind:
type: string
tracing:
$ref: "#/components/schemas/Tracing"
Tracing:
type: object
required:
- trace_id
properties:
trace_id:
type: string

View file

@ -1,71 +0,0 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
FavoriteTweet:
required:
- "favorite_tweet"
properties:
favorite_tweet:
type: string
UnfavoriteTweet:
required:
- "unfavorite_tweet"
properties:
unfavorite_tweet:
type: string
# ---Retweet---
CreateRetweet:
required:
- "result"
properties:
result:
type: object
items:
$ref: "#/components/schemas/Retweet"
DeleteRetweet:
required:
- "result"
properties:
result:
type: object
items:
$ref: "#/components/schemas/Retweet"
Retweet:
required:
- "rest_id"
- "legacy"
properties:
rest_id:
type: string
legacy:
type: object
items:
properties:
full_text:
type: string
# ---Tweet---
CreateTweet:
required:
- "result"
properties:
result:
type: object
items:
$ref: "./tweet.yaml#/components/schemas/Tweet"
DeleteTweet:
properties:
result:
type: object