Mermade / oas-kit

Convert Swagger 2.0 definitions to OpenAPI 3.0 and resolve/validate/lint

Home Page:https://mermade.org.uk/openapi-converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Operation with required form params does not have OAS3 required request body

mkistler opened this issue · comments

Checklist

  • Conversion: I have checked my source definition is valid OpenAPI 2.0
  • Conversion: On valid OpenAPI 2.0 input, the conversion looks wrong

Detailed Description

An operation that is defined in OAS 2.0 to have a required form parameter is converted into an operation in OAS 3.0 with an optional request body.

I believe that the operation request body in OAS 3.0 should be marked as required if any form or body parameters in the OAS 2.0 file are marked as required.

Other stuff

I have reproduced this issue with the latest available version (6.0.3) of swagger2openapi.

The following swagger file can be used to reproduce the problem:

swagger.yaml

swagger2openapi with no command line options produces this result on my system:

openapi.yaml