-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
feat: Implement JSON Schema Validation for User API Responses #17731
base: main
Are you sure you want to change the base?
feat: Implement JSON Schema Validation for User API Responses #17731
Conversation
Problem Solved: The Cal.com API v2 was exhibiting inconsistent behavior with response bodies changing unpredictably. This inconsistency was causing errors in applications relying on the API, leading to disruptions in functionality and user experience. The issue stemmed from a lack of a fixed and documented schema for API responses. Solution Implemented: Defined a JSON schema to establish a consistent structure for user-related API responses. Integrated the Ajv library into the UsersService to validate responses against the schema. Added validation logic in the getByUsernames method to ensure each user response adheres to the schema, throwing an error if it does not. Trade-offs or Limitations: The current implementation focuses on user-related responses. Extending schema validation to other modules may be necessary for comprehensive consistency. Future changes to the API response structure will require updates to the schema and potentially the validation logic. A versioning strategy and deprecation policy should be considered to manage future changes and maintain backward compatibility.
@AmpasTheodoros is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (11/19/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (11/19/24)1 label was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (11/21/24)1 label was added to this PR based on Keith Williams's automation. |
Hey @AmpasTheodoros please sign CLA |
Hey @Praashh thanks for fixing my title I just signed CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
E2E results are ready! |
Problem Solved: The Cal.com API v2 was exhibiting inconsistent behavior with response bodies changing unpredictably. This inconsistency was causing errors in applications relying on the API, leading to disruptions in functionality and user experience. The issue stemmed from a lack of a fixed and documented schema for API responses
Solution Implemented:
Trade-offs or Limitations: