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

CLI: Add request and response validation #555

Open
9 tasks
rajdip-b opened this issue Nov 22, 2024 · 5 comments
Open
9 tasks

CLI: Add request and response validation #555

rajdip-b opened this issue Nov 22, 2024 · 5 comments
Labels
difficulty: 4 priority: high scope: cli Everything related to the CLI type: enhancement New feature or request

Comments

@rajdip-b
Copy link
Member

Description

The CLI currently uses no validation at all. We would like the cli to use schema package to add validation to its modules. This will include input (request) and output (response) validation. The idea is, before making an API call, we would like to inspect the request body with the request schema. If it passes, we make the call. Similarly, when we get back a response from the API, we match the response with the response schema and print only those fields that matches the response type.

Solution

We would like to implement these changes across the following modules. The changes would include updating each and every command of every module to include validation.

  • Workspace
  • Workspace Role
  • Workspace Membership
  • Project
  • Environment
  • Secret
  • Variable
  • Integration
  • Event
@rajdip-b rajdip-b added type: enhancement New feature or request priority: high difficulty: 4 scope: cli Everything related to the CLI labels Nov 22, 2024
@yetanotheraryan
Copy link
Contributor

Hi @rajdip-b, Let me just clarify the problem statement here, we want to put in request and response schema for validations for all the API's in the mentioned modules list right? using any validation library like Joi for example?

Looking forward to contribute on the same.

@rajdip-b
Copy link
Member Author

Hey, all the validation is already set up in schema package. You can find it under packages/schema folder. You would need to import the schemas from the schema package one by one (for every module) and then validate the request and responses in the CLI app you can find under apps/cli. Hope that helps.

You can also refer how packages/api-client uses the schema package.

@vr-varad
Copy link
Contributor

vr-varad commented Dec 1, 2024

hey @rajdip-b I would like to work on this issue if its open for contribution

@rajdip-b
Copy link
Member Author

rajdip-b commented Dec 1, 2024

if @yetanotheraryan is not attempting it, then yes.

@vr-varad
Copy link
Contributor

vr-varad commented Dec 4, 2024

hey @yetanotheraryan are u working on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 4 priority: high scope: cli Everything related to the CLI type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants