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

Feature Request: OpenAPI Framework Support for Fastify #915

Open
SiddhantBohra opened this issue Dec 29, 2024 · 0 comments
Open

Feature Request: OpenAPI Framework Support for Fastify #915

SiddhantBohra opened this issue Dec 29, 2024 · 0 comments

Comments

@SiddhantBohra
Copy link

We currently have excellent support for OpenAPI integration with Express using libraries like express-openapi, which streamline the development of APIs by providing features such as validation, routing, and documentation based on OpenAPI specifications. However, there is a lack of a similar robust framework for the Fastify ecosystem, which is a fast, lightweight, and developer-friendly alternative to Express.

This feature request is for developing or integrating a library that offers similar OpenAPI capabilities for Fastify.

Key Features

  1. Schema-Driven Development
    • Generate routes, request validation, and response validation based on OpenAPI specifications.
    • Ensure that API implementations strictly follow the OpenAPI spec.
  2. Middleware & Hook Support
    • Ability to easily integrate with Fastify’s hooks, schema validation, and plugins for additional flexibility.
  3. Documentation Integration
    • Automatically generate API documentation (e.g., Swagger UI) based on the OpenAPI spec.
    • Support exporting the OpenAPI spec dynamically.
  4. Error Handling
    • Standardized error responses based on OpenAPI definitions.
  5. Extensibility
    • Provide hooks or extension points to customize the behavior, such as modifying schema or adding custom middleware.
  6. Compatibility with Fastify Ecosystem
    • Support Fastify’s plugin system and align with its performance and lightweight nature.

Benefits
• Improved developer productivity and consistency when building APIs with Fastify.
• Easier migration paths for teams moving from Express to Fastify while maintaining OpenAPI-based workflows.
• Streamlined process for adhering to API design-first principles.

Possible Implementation Considerations
• Base the architecture on existing Fastify plugins and schema validation features.
• Leverage existing OpenAPI parsers like swagger-parser or openapi-schema-validator.
• Include robust TypeScript support for type inference and validation.

References
express-openapi: The existing library for Express.
Fastify Documentation: Explore plugin and validation capabilities of Fastify.

Looking for Feedback
• Are there existing solutions or plugins that partially address this need?
• Suggestions for additional features or use cases to consider?
• Volunteers to help design or implement the library?

By creating this feature, we can empower the Fastify community to build OpenAPI-compliant APIs more efficiently while retaining the performance benefits of Fastify.

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

No branches or pull requests

1 participant