Comments (7)
I opened kuimono/openapi-schema-pydantic#19
We may as well leave this open as a reminder to track that.
from litestar.
That's not body, that's a query param of a type that can't be handled. If you change the key from value to data what happens?
The issue here is that the errors are swollen, no?
from litestar.
I've been looking too @Goldziher
I've repro'd with fresh environment and just starlite and uvicorn installed. Repro with:
import logging
from pydantic import BaseModel
from starlite import Starlite, post, Provide
class RouteData(BaseModel):
id: str
@post(path="/")
def route(data: RouteData) -> RouteData:
return data
app = Starlite(route_handlers=[route], openapi_config=None)
It happens even with the correct data
kwarg. Seems to be comming from openapi generation. If you set openapi_config=None
to app like I have in the script above it stops.
from litestar.
Seems to occur irrespective of handler method, e.g.,
from pydantic import BaseModel
from starlite import Starlite, get
class RouteData(BaseModel):
id: str
@get()
def route(value: RouteData) -> RouteData:
return value
app = Starlite(route_handlers=[route])
from litestar.
Seems to be comming from openapi generation
When I commented out all logging statements in openapi-schema-pydantic
package it started working fine.
https://github.com/kuimono/openapi-schema-pydantic/search?q=logging
from litestar.
Ah OK, good spot @vrslev.
I've just had a look and they use the module level logging handlers like logging.info()
rather than setting up a library scoped logger.
From logging docs:
This function (as well as info(), warning(), error() and critical()) will call basicConfig() if the root logger doesnโt have any handler attached.
By letting it call basicConfig()
another handler gets added to root logger and hence the duplicated messages.
So if you configure a handler to the root logger before calling Starlite()
then this would be avoidable I think, but you shouldn't have to. They should be instantiating named loggers for their lib and have a null handler attached to the root logger of their namespace so it doesn't affect downstream.
from litestar.
I've PR'd upstream for this so it is out of our hands now.
from litestar.
Related Issues (20)
- Docs: Refactor `/usage/responses` into a divided section HOT 2
- Docs: Build the `develop` branch documentation HOT 2
- Bug: exception are logged twice HOT 1
- Bug: Type Checker throws "Return type, "TestClient[Unknown]", is partially unknown" error message HOT 2
- Enhancement: Extract the DTO functionality to separate package HOT 5
- Bug: return DTO causes field descriptions in Pydantic model to disappear HOT 2
- Enhancement: Support for dictionaries with Pydantic models as value, e.g. dict[str, PydanticClass] HOT 6
- Bug: `root_schema_site` missing `scalar` option HOT 1
- Bug: advanced-alchemy's `wrap_sqlalchemy_exception()` has moved HOT 2
- build: `make docs-serve` watching polyfactory dir in litestar project
- Enhancement: Add plugin for grafana loki HOT 5
- Bug: slotscheck pre-commit misconfiguration HOT 2
- Enhancement: fully support builder pattern for apps HOT 8
- bug(docs): stale reference to pydantic signature models HOT 2
- docs: remove extra test func in test client fixture example
- Enhancement: Add 3.13 matrix
- Enhancement: Resource representation response based on `Accept` header HOT 6
- Bug: Unexpected openapi type in typescript generation HOT 2
- Bug: schema generation crashes in 2.7.1 HOT 3
- Bug: default not generated for query parameter in openapi spec. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from litestar.