Closed rolikoff closed 17 hours ago
Hi @rolikoff,
Could you please show how you generate OpenAPI schema?
Here is what component definition looks like in my case:
from fastapi import FastAPI
from fastapi_pagination import Page, add_pagination, paginate
app = FastAPI()
add_pagination(app)
@app.get("/")
async def get_items() -> Page[int]:
return paginate([])
{
"Page_int_": {
"properties": {
"items": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Items"
},
"total": {
"type": "integer",
"minimum": 0.0,
"title": "Total"
},
"page": {
"type": "integer",
"minimum": 1.0,
"title": "Page"
},
"size": {
"type": "integer",
"minimum": 1.0,
"title": "Size"
},
"pages": {
"type": "integer",
"minimum": 0.0,
"title": "Pages"
}
},
"type": "object",
"required": [
"items"
],
"title": "Page[int]"
}
}
But it use 3.1.0
OpenAPI version.
@rolikoff Any updates?
Hi @rolikoff,
I'm closing this issue, please reopen it in case if it still exists
I'm currently integrating a library with my FastAPI project and utilizing the following library versions:
I've established a test route within my project as follows:
However, I've encountered an issue with the OpenAPI Specification (OAS) YAML file generated, as it includes incorrect schema types:
I understand that OAS version 3.0.2 does not support
null
types, which may not be a direct issue withfastapi-pagination
. Minimum values are not ints, which is odd as well. Could you provide any insights into the underlying problem or suggest a possible solution?