[BUG][Kotlin][Spring] Test won't compile when parameter is required
Created by: Zomzog
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
Required parameter generate tests that won't compile
openapi-generator version
5.2.0
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: Repro
version: '1.0'
contact:
name: Vlad
email: vlad@vlad.vlad
paths:
'/getSome/{what}':
parameters:
- $ref: '#/components/parameters/repro'
- $ref: '#/components/parameters/what'
get:
responses:
'200':
description: OK
components:
parameters:
repro:
name: X-Repro
in: header
required: true
schema:
$ref: '#/components/schemas/Id'
what:
name: what
in: path
required: true
schema:
$ref: '#/components/schemas/Id'
schemas:
Id:
type: string
pattern: '^[0-9]+$'
minLength: 1
maxLength: 5
Related issues/PRs
Discovered while fixing #10702 (closed)
Suggest a fix
Replace null by TODO()
and handle ?
like in other templates