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

Allow to define requestBody and parameters in OpenAPI docstrings #121

Closed
perdy opened this issue Oct 6, 2023 · 0 comments · Fixed by #122
Closed

Allow to define requestBody and parameters in OpenAPI docstrings #121

perdy opened this issue Oct 6, 2023 · 0 comments · Fixed by #122
Milestone

Comments

@perdy
Copy link
Member

perdy commented Oct 6, 2023

To further customisation in OpenAPI docstring it's desirable to allow a request body definition like the following example:

@app.route("/custom-body/", methods=["POST"])
async def custom_body():
    """
    description: Custom body.
    requestBody:
        description: The body request
        required: true
        content:
            multipart/form-data:
                schema:
                    type: object
                    properties:
                        model:
                            type: string
                            format: binary
                            description: The model file
                        name:
                            type: string
                            description: The model name
                        description:
                            type: string
                            description: The model description
    responses:
      200:
        description: OK.
    """
    return {}

Also, a parameters redefinition like:

@app.route("/custom-params/", methods=["GET"])
async def custom_params(name: str):
    """
    description: Custom params.
    parameters:
      - in: query
        name: name
        schema:
            type: string
        required: true
        description: The query param
    responses:
      200:
        description: OK.
    """
    return {}
@perdy perdy added this to the 1.7.0 milestone Oct 6, 2023
@perdy perdy changed the title Allow to define requestBody in OpenAPI docstrings Allow to define requestBody and parameters in OpenAPI docstrings Oct 6, 2023
perdy added a commit that referenced this issue Oct 6, 2023
@perdy perdy linked a pull request Oct 6, 2023 that will close this issue
perdy added a commit that referenced this issue Oct 6, 2023
@perdy perdy closed this as completed Oct 6, 2023
perdy added a commit that referenced this issue Oct 6, 2023
@perdy perdy mentioned this issue Oct 6, 2023
perdy added a commit that referenced this issue Oct 24, 2023
github-actions bot pushed a commit that referenced this issue Sep 3, 2024
# [v1.7.0](v1.6.0...v1.7.0) (2024-09-03)

## ✨ New Features
- [`96229a1`](96229a1)  Decouple table manager logic from repositories (#118) (Issues: [`#118`](https://github.com/vortico/flama/issues/))
- [`d944180`](d944180)  Enhanced OpenAPI docstrings (#121) (Issues: [`#121`](https://github.com/vortico/flama/issues/))
- [`a66d5ee`](a66d5ee)  Enhanced actions for DDD repositories (#124) (Issues: [`#124`](https://github.com/vortico/flama/issues/))
- [`0695c77`](0695c77)  ASGI Cookies component
- [`cd06bdb`](cd06bdb)  Python 3.12 compatibility (#119) (Issues: [`#119`](https://github.com/vortico/flama/issues/))
- [`a2ef280`](a2ef280)  Single type injection (#126) (Issues: [`#126`](https://github.com/vortico/flama/issues/))
- [`869711d`](869711d)  Connections manager for SQLAlchemy module (#135) (Issues: [`#135`](https://github.com/vortico/flama/issues/))
- [`4899473`](4899473)  Authentication mechanism (#137) (Issues: [`#137`](https://github.com/vortico/flama/issues/))
- [`03634c2`](03634c2)  Ordering for repositories list (#139) (Issues: [`#139`](https://github.com/vortico/flama/issues/))
- [`070fb4f`](070fb4f)  Enhanced operations for CRUD (#141) (Issues: [`#141`](https://github.com/vortico/flama/issues/))
- [`bd4f6c1`](bd4f6c1)  Non-blocking errors on schema generation
- [`4e5ba47`](4e5ba47)  Implement DDD for HTTP resources
- [`c177eef`](c177eef)  Use PartialSchema for all-optional schema version
- [`336914e`](336914e)  HTTPWorker accepts client kwargs

## 🐛 Bug Fixes
- [`518a4eb`](518a4eb)  Fix resolution for routes within nested resources
- [`3e1c0a8`](3e1c0a8)  Include nested applications in Lifespan (#130) (Issues: [`#130`](https://github.com/vortico/flama/issues/))
- [`036264e`](036264e)  Resolve url match multiple path params
- [`2664aba`](2664aba)  Remove unintended sqlalchemy import (#143) (Issues: [`#143`](https://github.com/vortico/flama/issues/))
- [`cde8071`](cde8071)  Serve flama logo from its repository (#144) (Issues: [`#144`](https://github.com/vortico/flama/issues/))
- [`9bcd6d7`](9bcd6d7)  Accept empty body as a valid input for schema validation
- [`c4d0915`](c4d0915)  Fix middleware types
- [`5716a6f`](5716a6f)  Allow nullable nested schemas for Pydantic
- [`8836aa7`](8836aa7)  Atomic operations on SQLAlchemy connections management
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 a pull request may close this issue.

1 participant