hopeit-git / hopeit.engine

Python engine that allows creation and operations of reactive microservices
https://hopeitengine.readthedocs.io/en/latest/
Apache License 2.0
22 stars 4 forks source link

bug(engine): default response openapi description change between versions of python #156

Open pcanto-hopeit opened 1 year ago

pcanto-hopeit commented 1 year ago

event_apiproduce different default values between different versions of python in the response.description:

code:

__api__ = event_api(
    summary="Simple Example: List Objects",
    query_args=[
        ('wildcard', Optional[str], "Wildcard to filter objects by name")
    ],
    responses={
        200: List[Something]
    }
)

in Python 3.8 produce:

  "/api/simple-example/0x17/list-somethings": {
      "get": {
        "summary": "Simple Example: List Objects",
...
        "responses": {
          "200": {
            "description": "typing.List[model.Something]",
...    },

in Python 3.11 produce:

  "/api/simple-example/0x17/list-somethings": {
      "get": {
        "summary": "Simple Example: List Objects",
...
        "responses": {
          "200": {
            "description": "List",
- ...    },

this error could be present in query_args processing

leosmerling-hopeit commented 1 year ago

Make non-python dependant default value: i.e. list-somethings result

For the query args: {arg-name}