-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Open
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
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 FoundGeneration Details
There is a sample repository to reproduce.
Steps to reproduce
- Clone the sample repository
- run the
mvn generate-sourcescommand - examine generated sources