-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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 search for related issues/PRs?
- What's the version of OpenAPI Generator used?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
Vendor extensions added to the request body section of the specification are not available in mustache templates.
openapi-generator version
3.4.1
OpenAPI declaration file content or url
Command line used for generation
paths:
/users:
post:
summary: Adds a new user
requestBody:
x-foo: "extension" # <- not available in mustache templates
content:
application/json:
schema: # Request body contents
type: object
properties:
id:
type: integer
name:
type: string
example: # Sample object
id: 10
name: Jessica Smith
responses:
'200':
description: OKSteps to reproduce
Generate server API from the snippet above, using a custom bodyParts.mustache template containing {{{vendorExtensions.x-foo}}}, which will be empty.
Related issues/PRs
Suggest a fix
DefaultCodegen.fromRequestBody should probably copy the vendor extensions from RequestBody to CodegenParameter
Reactions are currently unavailable