-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Uncomment the status.isNullable test in RubyClientCodegenTest.java since #820 is now solved in swagger-parser #981
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
Conversation
e457d07 to
6a739f9
Compare
|
Thank you for having a look at this... I am not sure if it will work out of the box, but this is something we need to investigate. |
6a739f9 to
26f15f5
Compare
|
@jmini I realized that I also needed to update the EDIT: Actually I'm getting this error: Maybe the package has not been updated in the repository, or I made a mistake. |
Not exactly. The current I did a release of The PR to update to Sorry if you spend time on figuring out which version you should use. Please revert Swagger-Parser version changes in your PR. Now to come back to the change you want to make in this PR, I am not sure that the code prepared by @wing328 in the PR #889 to cover the case of a nullable form parameter (OASv2) in the generator code, might not be exactly compatible with the way Swagger-Parser does the conversion. When form parameters are present in OASv2, a request-body is added in OASv3. Each parameter becomes a property in the Schema of the request body. Example (OASv2 input): swagger: "2.0"
info:
version: "1.0.1"
title: "OpenAPI-Generator PR 889"
basePath: "/v1"
host: "localhost:8099"
schemes:
- http
paths:
/one:
get:
operationId: "op1"
parameters:
- name: myparam
in: formData
description: first description
required: false
type: string
x-nullable: true
responses:
200:
description: "success"
Output of the Swagger-Parser (OASv3): openapi: 3.0.1
info:
title: OpenAPI-Generator PR 889
version: 1.0.1
servers:
- url: http://localhost:8099/v1
paths:
/one:
get:
operationId: op1
requestBody:
content:
multipart/form-data:
schema:
properties:
myparam:
type: string
description: first description
nullable: true
responses:
200:
description: successNow if you have 3 parameters (OASv2): parameters:
- name: foo
in: formData
description: some foo param
required: false
type: string
x-ext: some foo
- name: bar
in: formData
description: some bar param
required: true
type: integer
x-nullable: true
x-ext: some bar
- name: baz
in: formData
description: some baz param
required: true
type: integer
x-nullable: false
x-ext: some bazOutput of the Swagger-Parser (OASv3): I do not think that Swagger-Parser can do a better job. My take is that for the moment, OpenAPI-Generator is only looking for the schema of the |
|
The test is already uncomment in the master |
I just saw this line in
RubyClientCodegenTest.javathat said:That issue is now solved, so I've updated the
swagger-parser-versionto2.0.4and uncommented this line.