Skip to content
Advertisement

Tag: schema

Pydantic schema logic

So, I’m building an API to interact with my personal wine labels collections database. For what I understand, a pydantic model purpose is to serve as a “verifier” of the schema that is sent to the API. So, my pydantic schema for adding a label is the following: None of the fields is to be updated automatically. This is equal

consuming Kafka Avro massages in Python

I am trying to consume messages from Kafka Avro in Python. We have it in Java, and it’s working, but when trying to consume it in the Jupyter notebook, Parsing does not work. I followed the example given by the documentation: (I’ve removed conf information for security reasons) This is the error I got: KafkaError{code=_KEY_DESERIALIZATION,val=-160,str=”‘str’ object is not callable”} It

How to disable schema checking in FastAPI?

I am migrating a service from Flask to FastAPI and using Pydantic models to generate the documentation. However, I’m a little unsure about the schema check. I’m afraid there will be some unexpected data (like a different field format) and it will return an error. In the Pydantic documentation there are ways to create a model without checking the schema:

Advertisement