Closed claeyswo closed 5 months ago
Hi @claeyswo thanks for the report.
This one looks similar to https://github.com/python-openapi/openapi-core/pull/802. The fix is in the latest master.
That seems to be the problem. Any thoughts on when this will be released?
Hello,
I encountered the same issue with V30RequestUnmarshaller integrated in django framework. I only need to unmarshal the request data, so I did not test the response unmarshaller.
Allow me to reuse the statement of @claeyswo, modified with my situation.
Actual Behavior I'm trying to instantiate a V30RequestUnmarshaller with extra_format_unmarshallers. Sometime during the initialization process however they get overwritten with None.
Expected Behavior That the extra_format_unmarshallers dict is equal to the one I provide.
Steps to Reproduce
from openapi_core.unmarshalling.request import V30RequestUnmarshaller
from openapi_core import OpenAPI, Config
from datetime import datetime
def unmarshal_iso_datetime(value):
return datetime.strptime(value, "%Y-%m-%d %H:%M:%S")
extra_format_unmarshallers = {
'iso_datetime': unmarshal_iso_datetime,
}
config = Config(extra_format_unmarshallers=extra_format_unmarshallers)
OPENAPI = OpenAPI.from_file_path('index.yaml', config=config)
v30_request_unmarshaller = V30RequestUnmarshaller(
OPENAPI, extra_format_unmarshallers=extra_format_unmarshallers
)
print(v30_request_unmarshaller.extra_format_unmarshallers)
The above code snippet returns None
.
where the index.yaml is the following:
openapi: 3.0.1
servers:
- url: http://0.0.0.0:8004/
description: Local Debug Server
info:
version: 2.0.0
title: test
paths:
/test/:
post:
tags:
- test
summary: test
description: test
operationId: test
requestBody:
content:
application/json:
schema:
type: object
properties:
create_date:
type: string
format: iso_datetime
example: '2023-02-09 09:00:00'
required:
- create_date
responses:
'200':
description: Success
content:
application/json: {}
OpenAPI Core Version 0.19.0
OpenAPI Core Integration django
Fixed with #802
Actual Behavior
I'm trying to instantiate a V31RequestUnmarshaller with extra_format_unmarshallers. Sometime during the initialization process however they get overwritten with None. No problem for the V31ResponseUnmarshaller
Expected Behavior
That the extra_format_unmarshallers dict is equal to the one I provide.
Steps to Reproduce
Output:
OpenAPI Core Version
0.19.0
OpenAPI Core Integration
pyramid_openapi3
Affected Area(s)
No response
References
No response
Anything else we need to know?
No response
Would you like to implement a fix?
None