Flemming Nørnberg Larsen a4508f6817
#18058 Fix the Java generator to generate valid @RequestMappings where the produce field takes list of string parameters instead of a single comma-separated string (#18092)
* #18058 Fix AbstractJavaCodegen.getAccepts() so it returns a String array instead of a comma-separated string, and fixed api.mustache so the @RequestMapping annotation generated produces for x-accepts as a parameter list instead of a (single) string.

* #18058 Updated test case to accept a string array instead of a comma-separated list.

* #18058 Reverted changes on imported compared to the main branch.

* #18058 getAccepts() is now hybrid, and can return both a single String or a String[].

* #18058 Rolled back the hybrid getAccepts(), so it only returns a String array.

* #18058 Updated mustache files to cope with vendorExtensions.x-accepts being a string array instead of a comma-separated string.

* #18058 Generated new sample files with by running `./bin/generate-samples.sh ./bin/configs/*.yaml`

* #18058 Optimization of getAccepts()

* #18058 Regenerated scripts that got broken after resolving conflicts on GitHub

* #18058 Fixed introduced issue with api.mustache causing a redundant accept with @HttpExchange with the PetApi.java, StoreApi.java, and UserApi.java.
2024-03-21 17:53:18 +08:00

99 lines
2.1 KiB
YAML

openapi: 3.0.1
info:
title: ping some object
version: "1.0"
servers:
- url: http://localhost:8082/
paths:
/ping:
get:
operationId: getPing
parameters:
- description: ID of pet that needs to be updated
explode: true
in: query
name: petId
required: true
schema:
format: int64
type: integer
style: form
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/getPing_request'
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/SomeObj'
description: OK
tags:
- ping
x-streaming: true
x-group-parameters: true
x-content-type: application/x-www-form-urlencoded
x-accepts:
- application/json
post:
operationId: postPing
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SomeObj'
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/SomeObj'
description: OK
tags:
- ping
x-streaming: true
x-content-type: application/json
x-accepts:
- application/json
components:
schemas:
SomeObj:
example:
name: name
active: true
$_type: SomeObjIdentifier
id: 0
type: type
properties:
$_type:
default: SomeObjIdentifier
enum:
- SomeObjIdentifier
type: string
id:
format: int64
type: integer
name:
type: string
active:
type: boolean
type:
type: string
type: object
SimpleOneOf:
oneOf:
- type: string
- type: integer
getPing_request:
properties:
name:
description: Updated name of the pet
type: string
status:
description: Updated status of the pet
type: string
type: object