Bug Report Checklist
Description
Using the required property in the requestBody has no effect when using the Spring Java generator.
openapi-generator version
6.6.0, 7.0.0, also detected on 7.0.1-SNAPSHOT.
OpenAPI declaration file content or url
openapi: 3.0.3
info:
title: "Sample API"
version: 1.0.0
contact:
name: App
url: https://localhost
description: Sample OAS for bug.
paths:
/upload/{id}/file:
put:
operationId: "putFile"
parameters:
- name: "id"
in: "path"
description: ID
required: true
schema:
pattern: \\d{4}
type: string
example: "1234"
requestBody:
required: true
description: File image
content:
multipart/form-data:
schema:
properties:
file:
type: string
format: binary
encoding:
file:
contentType: image/png, image/jpeg
responses:
204:
description: Uploaded
404:
description: Not Found
Generation Details
There is a sample repository to reproduce.
Steps to reproduce
- Clone the sample repository
- run the
mvn generate-sources command
- examine generated sources
Related issues/PRs
Suggest a fix
Bug Report Checklist
Description
Using the
requiredproperty in therequestBodyhas no effect when using the Spring Java generator.openapi-generator version
6.6.0,7.0.0, also detected on7.0.1-SNAPSHOT.OpenAPI declaration file content or url
Generation Details
There is a sample repository to reproduce.
Steps to reproduce
mvn generate-sourcescommandRelated issues/PRs
Suggest a fix