Open usrivastava92 opened 5 months ago
Regarding your first issue: as you haven't specified any library it defaults to okhttp-gson
, which – as the name suggests – currently only supports GSON (a request to add Jackson has been pending for a while, see #1648).
I would strongly agree that it would be helpful if the generator gave feedback on this immediately instead of generating something unexpected, but that's a different issue (i've therefore opened #18852).
Apart from that, it works as expected, so maybe you can change the issue title to only refer to the second issue – which i agree is sort of critical, i'll have a look at it.
Running into this as well. Model only generation is generating like:
public class SearchResponseContentInner extends AbstractOpenApiSchema {
where AbstractOpenApiSchema
does not exist.
It also tries to import non-existent class com.mypackage.JSON
so it appears model-only generation is just fundamentally broken atm.
enablePostProcessFile.set(false)
validateSpec.set(true)
library.set("native")
generateModelDocumentation.set(false)
generateModelTests.set(false)
generateApiTests.set(false)
globalProperties.set(
mapOf(
"apis" to "false",
"invokers" to "false",
"models" to "",
),
)
configOptions.set(
mapOf(
// Needed due to regression https://github.com/OpenAPITools/openapi-generator/issues/19142
"supportUrlQuery" to "false",
"dateLibrary" to "java8",
"serializationLibrary" to "jackson",
"useBeanValidation" to "true",
"performBeanValidation" to "true",
"useJakartaEe" to "true",
"sourceFolder" to ".",
"annotationLibrary" to "none",
"hideGenerationTimestamp" to "true",
),
)
Bug Report Checklist
Actual output:
AbstractOpenApiSchema
class missing when generating only models. Code can be found hereserializationLibrary=jackson
as configOptions. Code can be found hereDescription
I am trying to generate only models using openapi-codegen. I am using Java generator using Gradle plugin and generated source has following issues:
AbstractOpenApiSchema
class missing when generating only models. Code can be found hereserializationLibrary=jackson
as configOptions. Code can be found hereopenapi-generator version
Gradle plugin ->
id("org.openapi.generator") version "7.6.0"
CLI Version ->openapi-generator-cli 7.6.0
OpenAPI declaration file content or url
https://github.com/usrivastava92/openapi-codegen/blob/8e1e2a889600d3ccdab8153900ad39d0f66f6195/openapi.json
Steps to reproduce
cd java && gradle openApiGenerate
command inside the repo to replicated the issueRelated issues/PRs
N/A