openapi-generator: [DefaultCodegen] Possible missing model for request body for OAS 3.0
Description
Consider the following spec:
openapi: 3.0.0
info:
title: Test
version: 1.0.0
servers:
- url: 'http://test/'
components:
requestBodies:
TestBodyInline:
content:
application/json:
schema:
type: object
properties:
test:
type: string
paths:
/test/ref/inline:
post:
summary: Test
requestBody:
$ref: '#/components/requestBodies/TestBodyInline'
responses:
'200':
description: Success
content:
application/json:
schema:
type: string
For this spec CodegenOperation::bodyParam.dataType equals to “object” and no codegen model is generated for request body. A bit lost why this is happenning because 3 other possible scenarios (inline body + inline schema, inline body + ref schema, ref body + ref schema) work perfectly well.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 9
- Comments: 15 (13 by maintainers)
Commits related to this issue
- Merge pull request #8 from egeniq-forks/f/stringdesc No need for unused StringDescriptor — committed to Thecrazyskull/openapi-generator by Thecrazyskull 4 years ago
- Merge pull request #8 from OpenAPITools/master merge master — committed to hanakslr/openapi-generator by ksvirkou-hubspot 2 years ago
- Merge pull request #8 from birdofpreyru/master Propagates generator exit code to the parent NodeJS process — committed to nilskuhn/openapi-generator by kay-schecker 5 years ago
I just hit by this. still happened on 4.0.0.beta.
I’ve started having a look at restoring InlineModelResolver.java - see https://github.com/bjgill/openapi-generator/tree/InlineModelResolver.
I’m now out of time to work on this for now, however. Anyone else who wants to pick this up would be more than welcome.
OK - the following (v2) definition was fixed by #736 (thanks @antihax!):
However, the following still doesn’t seem to work (at least for
rust-server):