-
-
Notifications
You must be signed in to change notification settings - Fork 227
Exception when generating list properties in multipart forms #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's failing to mee too with version 0.10.0 but working if I downgrade to 0.9.2 I have installed openapi-python-client on a clean virtual environment using pip. $ python --version
Python 3.8.10
$ pip freeze
anyio==3.2.1
appdirs==1.4.4
attrs==21.2.0
autoflake==1.4
black==21.6b0
certifi==2021.5.30
click==7.1.2
h11==0.12.0
httpcore==0.13.6
httpx==0.18.2
idna==3.2
isort==5.9.2
Jinja2==3.0.1
MarkupSafe==2.0.1
mypy-extensions==0.4.3
openapi-python-client==0.9.2
pathspec==0.8.1
pydantic==1.8.2
pyflakes==2.3.1
python-dateutil==2.8.1
PyYAML==5.4.1
regex==2021.7.6
rfc3986==1.5.0
shellingham==1.4.0
six==1.16.0
sniffio==1.2.0
toml==0.10.2
typer==0.3.2
typing-extensions==3.10.0.0 |
Thanks for the report and confirmation! Looks like this was due to #372. @csymeonides-mf if you get a chance could you look into a fix? If not, I can probably sort one out this weekend. |
Apologies for this, will investigate asap |
@dpursehouse @slamora could you please share your openapi JSON/yaml, or at least the part that causes the failure? |
Presumably you have something like this?
but surely you want |
The OpenAPI spec seems to be advising that, if we want to allow uploading multiple files, we should use something like this:
|
Thanks for jumping on this so quick! Hopefully we can get some sample schemas and expected results from OPs. I'm not exactly sure what the "correct" behavior is in this case. |
@csymeonides-mf thanks. In the case that exposed the issue, the yaml file contains a section that looks exactly as you imagined, i.e.
The yaml is being generated by |
From my site, the yaml has being generated by management command openapi: 3.0.2
info:
title: ''
version: ''
paths:
/api/databaseusers/{id}/set_password/:
post:
operationId: set_passwordDatabaseUser
description: ''
parameters:
- name: id
in: path
required: true
description: A unique integer value identifying this database user.
schema:
type: string
requestBody:
content:
application/json:
schema: &id059
properties:
password:
type: string
maxLength: 128
required:
- password
application/x-www-form-urlencoded:
schema: *id059
multipart/form-data:
schema: *id059
responses:
'200':
content:
application/json:
schema:
properties:
password:
type: string
maxLength: 128
required:
- password
description: '' |
With version 0.10.1 the client generation succeeds, thanks, however there is now a new bug #453 which prevents from using it. |
After upgrading from 0.9.2 to 0.10.0 the client generation fails with:
The text was updated successfully, but these errors were encountered: