From 7ce389393df47333e1ad01fe2cd883cb4209a01b Mon Sep 17 00:00:00 2001 From: Manan Date: Tue, 24 Oct 2023 00:33:46 -0700 Subject: [PATCH] feat: add recommendation section --- .github/workflows/rdme-openapi.yml | 6 + src/v2/recommendation/spec.yaml | 185 +++++++++++++++++++++++++++++ src/v2/spec.yaml | 2 +- 3 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 src/v2/recommendation/spec.yaml diff --git a/.github/workflows/rdme-openapi.yml b/.github/workflows/rdme-openapi.yml index 1f1286c..38fc252 100644 --- a/.github/workflows/rdme-openapi.yml +++ b/.github/workflows/rdme-openapi.yml @@ -21,3 +21,9 @@ jobs: uses: readmeio/rdme@v8 with: rdme: openapi src/v2/spec.yaml --key=${{ secrets.README_API_KEY }} --id=653140896cad5a001321c86f + + - name: Run `openapi` command 🚀 + uses: readmeio/rdme@v8 + with: + rdme: openapi src/v2/recommendation/spec.yaml --key=${{ secrets.README_API_KEY }} --id=6537721ac0ccd40031482643 + \ No newline at end of file diff --git a/src/v2/recommendation/spec.yaml b/src/v2/recommendation/spec.yaml new file mode 100644 index 0000000..1700e8d --- /dev/null +++ b/src/v2/recommendation/spec.yaml @@ -0,0 +1,185 @@ +openapi: 3.0.0 +info: + title: Recommendation API V2 + version: "2.0" +servers: + - url: https://api.neynar.com/v2 + +components: + schemas: + Address: + type: string + description: Ethereum address + Fid: + type: integer + format: int32 + default: 3 + description: User identifier (unsigned integer) + ActiveStatus: + type: string + enum: + - active + - inactive + description: | + The status of a user. + - active: The user is currently active. + - inactive: The user is not currently active. + User: + type: object + required: + - fid + - username + - display_name + - pfp_url + - profile + - follower_count + - following_count + - verifications + - activeStatus + properties: + fid: + $ref: "#/components/schemas/Fid" + username: + type: string + display_name: + type: string + custody_address: + $ref: "#/components/schemas/Address" + pfp_url: + type: string + description: The URL of the user's profile picture + profile: + type: object + required: + - bio + properties: + bio: + type: object + required: + - text + properties: + text: + type: string + follower_count: + type: integer + format: int32 + description: The number of followers the user has. + following_count: + type: integer + format: int32 + description: The number of users the user is following. + verifications: + type: array + items: + $ref: "#/components/schemas/Address" + activeStatus: + $ref: "#/components/schemas/ActiveStatus" + ErrorRes: + type: object + required: + - message + description: Returns ErrorRes metadata + properties: + code: + type: string + message: + type: string + property: + type: string + status: + type: integer + format: int32 + RelevantMint: + type: object + description: A mint object relevant to the user + required: + - contract_address + - token_id + - block_number + - tx_hash + - minter + properties: + contract_address: + $ref: "#/components/schemas/Address" + token_id: + type: string + block_number: + type: integer + format: int32 + tx_hash: + type: string + minter: + $ref: "#/components/schemas/User" + + + parameters: + ApiKey: + name: api_key + in: header + required: true + schema: + type: string + default: NEYNAR_API_DOCS + description: API key required for authentication. + + responses: + 500Response: + description: "Server Error" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorRes" + +tags: + - name: NFT + description: NFT Recommendations API + externalDocs: + description: NFT Recommendations API + url: https://docs.neynar.com/reference/ + +paths: + /nft/relevant_mints: + get: + tags: + - NFT + summary: Fetches all mints relevant for an user's ethereum address given a contract address (and optionally tokenId for ERC1155s) + description: Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) + operationId: signer + parameters: + - $ref: '#/components/parameters/ApiKey' + - name: address + required: true + in: query + example: "0x5a927ac639636e534b678e81768ca19e2c6280b7" + schema: + $ref: "#/components/schemas/Address" + - name: contract_address + required: true + in: query + example: "0xe8e0e543a3dd32d366cb756fa4d112f30172bcb1" + schema: + $ref: "#/components/schemas/Address" + - name: token_id + required: false + in: query + example: "1" + schema: + type: string + responses: + "200": + description: Successful operation. + content: + application/json: + schema: + type: object + required: + - mints + properties: + mints: + type: array + items: + $ref: "#/components/schemas/RelevantMint" + + + "500": + $ref: "#/components/responses/500Response" diff --git a/src/v2/spec.yaml b/src/v2/spec.yaml index 0822348..a70ff30 100644 --- a/src/v2/spec.yaml +++ b/src/v2/spec.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Farcaster API V2 - version: "1.0" + version: "2.0" servers: - url: https://api.neynar.com/v2