I am using the maven plugin openapi-generator-maven-plugin (python generator), to generate Python code that includes UUID fields. Since 7.15 version of this plugin, the to_json method of the generated python object containing an UUID field leads to this error: Object of type UUID is not JSON serializable error
There is an example to reproduce the issue
components:
schemas:
MyObject:
type: object
properties:
id:
type: string
format: uuid
from my_api.model.my_object import MyObject
import uuid
obj = MyObject(id=uuid.uuid4())
json_str = obj.to_json()
I am using the maven plugin openapi-generator-maven-plugin (python generator), to generate Python code that includes UUID fields. Since 7.15 version of this plugin, the to_json method of the generated python object containing an UUID field leads to this error:
Object of type UUID is not JSON serializable errorThere is an example to reproduce the issue