Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add descriptions/examples for hub-rest-api #272

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link

docs: add descriptions/examples for hub-rest-api

Added comprehensive descriptions and examples for all message data schemas in the hub-rest-api OpenAPI specification, including:

  • MessageDataReaction schema (reactions to casts)
  • MessageDataLink schema (following relationships)
  • MessageDataVerificationAdd schema (address verification)
  • MessageDataVerificationRemove schema (remove verification)
  • MessageDataUserDataAdd schema (profile updates)
  • MessageDataFrameAction schema (frame interactions)

Each schema now includes:

  • Detailed descriptions of its purpose and usage
  • Clear explanations of all properties
  • Relevant examples demonstrating proper usage

Changes have been validated using Spectral and Swagger CLI.

Link to Devin run: https://app.devin.ai/sessions/5db8cfb89a4f49148531fa9d61093125

Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

@wtfsayo wtfsayo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary for neynarxyz/OAS Pull Request #272 for fun via copilot

Files Changed

  • src/hub-rest-api/spec.yaml

Key Changes in src/hub-rest-api/spec.yaml

  1. Parameter Descriptions:

    • Updated descriptions for parameters such as dbstats, fid, hash, and url to provide more detailed information.
    • Added examples for parameters to illustrate valid values.
  2. Response Descriptions:

    • Enhanced descriptions for response fields like nextPageToken to explain their usage and format.
    • Added examples for response fields and parameters to clarify expected data formats.
  3. Component Schema Updates:

    • Improved descriptions for various components, including CastId, CastHash, FrameActionBody, and LinkBody.
    • Added examples for component properties to demonstrate valid values.
  4. Message Data Changes:

    • Added detailed descriptions for message data types like MessageDataCastAdd, MessageDataCastRemove, MessageDataReaction, and MessageDataUserDataAdd.
    • Provided examples for message properties to illustrate valid data formats.
  5. Overall Improvements:

    • The changes improve clarity and usability of the API documentation.
    • The enhancements provide better guidance for API consumers, including detailed descriptions and examples.

Review Notes

  • The changes are primarily focused on improving the documentation by providing clearer descriptions and examples.
  • No functional code changes have been made, indicating that this PR is purely for documentation improvement.

These updates enhance the developer experience by making the API documentation more comprehensive and easier to understand. The added examples and detailed descriptions will help users implement and use the API more effectively.

Copy link
Collaborator

@Shreyaschorge Shreyaschorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General Feedback:

  1. If the description is already present in the schema, do not add a description where the schema is used, unless there is something specific that differs (for example, fid and targetFid can have the same schema but may have different meanings depending on where they are used).
  2. The nextPageToken should be centralized.

- name: url
in: query
description: "The URL associated with the parent cast. This can be used as an alternative to the FID+hash combination for identifying a parent cast. Supports both standard HTTP(S) URLs (e.g., Warpcast conversation URLs) and chain URLs (e.g., NFT references). The URL must match exactly with the URL stored in the parent cast. Not required if using FID+hash lookup."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL description is not correct

example: chain://eip155:1/erc721:0x39d89b649ffa044383333d297e325d42d31329b2
format: uri
examples:
- "https://warpcast.com/~/conversations/0x776593353e47dc4e7f4df3199a9b04cc8efa30d9" # Warpcast conversation URL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example won't work with the API

@@ -230,13 +259,18 @@ paths:
type: object
properties:
messages:
description: "An array of reply casts to the specified parent cast, ordered by recency (newest first). Each cast includes its content, timestamp, and other metadata."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the newest first but the other way around

examples:
- 616 # Example creator FID
- 1337 # Another creator FID
- 42069 # Popular creator FID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 3, since Dan is the high quality user

@@ -336,9 +377,13 @@ paths:
items:
$ref: "#/components/schemas/Reaction"
nextPageToken:
description: "Base64-encoded pagination token for fetching the next page of results. An empty value indicates there are no more pages to return. Used in conjunction with the pageSize parameter to implement pagination across large result sets."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nextPageToken should be a Schema and it should be referenced everywhere else instead of defining it in every single response

externalDocs:
description: "Fetch reactions by a target URL"
url: https://docs.neynar.com/reference/fetch-reactions-by-target
operationId: fetch-reactions-by-target
parameters:
- name: url
in: query
description: The URL of the parent cast
description: "The target URL to fetch reactions for. Can be a regular HTTP(S) URL or a chain URL (e.g., for NFTs). The URL must match exactly with the URL in the original reaction."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't be a http URL

- name: reaction_type
in: query
description: The type of reaction, either as a numerical enum value or string representation
description: "The specific type of reaction to filter by. Can be either a like (showing appreciation) or recast (sharing to user's audience). This parameter helps narrow down the reaction results to a specific interaction type."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description should be in the description of the schema ReactionType so that the same description doesn't repeat everywhere.

type: object
properties:
type:
description: "Specifies the type of social connection. Currently only supports 'follow' to indicate following another user."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description should be on the LinkType schema

targetFid:
title: The FID the link relates to
title: "Target User FID"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

targetFid and fid should be a single schema that should referenced everywhere else

allOf:
- $ref: "#/components/schemas/MessageDataCommon"
- type: object
required:
- linkBody
properties:
linkBody:
description: "Contains the details of the social connection, including the type of relationship and the target user."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the schema already has a description then there is no need to have another description here, unless there is anything specific like targetFid and fid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants