OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.4k stars 6.47k forks source link

Dependency on client if only generating models #13848

Open ploef opened 1 year ago

ploef commented 1 year ago

Hi,

Using the csharp-netcore generator, I only need the models to be generated.

--global-property=models,modelDocs=false,modelTests=false,apiTests=false
"packageName": "Test",
  "targetFramework": "net6.0",
  "optionalProjectFile": false,
  "optionalAssemblyInfo": false,
  "optionalEmitDefaultValue":  true,
  "validatable": false,
  "useCollection": true,
  "returnICollection": true,
  "optionalEmitDefaultValues": true,
  "library": "generichost"

Unfortunately the models have a dependency on the client because they include JsonConverters

 Utf8JsonReader guidReader = reader;
            bool guidDeserialized = Client.ClientUtils.TryDeserialize<Guid>(ref guidReader, options, out Guid? guid);

            Utf8JsonReader academicSessionReader = reader;
            bool academicSessionDeserialized = Client.ClientUtils.TryDeserialize<AcademicSession>(ref academicSessionReader, options, out AcademicSession? academicSession);

Is there a way I could make those models not needing the client?

viktoreinars commented 6 months ago

Same need here.