-
Notifications
You must be signed in to change notification settings - Fork 83
Validate OpenAPI slug with pattern #1029
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
Validate OpenAPI slug with pattern #1029
Conversation
🦋 Changeset detectedLatest commit: b796508 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Pull Request Overview
This PR adds validation for OpenAPI specification slugs to ensure they match required patterns and length constraints before publishing. The changes extract validation constants from the OpenAPI spec and implement client-side validation with improved error handling.
Key Changes:
- Added slug validation using pattern matching and length constraints from the API spec
- Introduced a logger utility for consistent error messaging
- Created a build-time script to extract constants from OpenAPI specification
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/openapi/publish.ts | Added validateSlug function to validate slugs before API calls; improved error handling with logger |
| packages/cli/src/logger.ts | New logger utility with colored console output for different log levels |
| packages/cli/package.json | Added picocolors dependency for terminal color support |
| packages/api/src/index.ts | Exported constants module to make validation constants available |
| packages/api/scripts/extract-constants.ts | Build script to extract validation constants from OpenAPI specification |
| packages/api/build.sh | Added step to run constants extraction during build |
| packages/api/.gitignore | Ignore generated constants.ts file |
| .changeset/funny-geese-mix.md | Changeset documenting the slug validation feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b977d2d to
5b88011
Compare
commit: |
9aeb770 to
b796508
Compare
No description provided.