You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SashaVolushkova
changed the title
[BUG] Type problem (object instead String, Integer etc)
[BUG] Type problem if using OpenApi 3.1 (object instead String, Integer etc)
Apr 12, 2023
Hi,
the problem here is that OpenAPI 3.1.0 is not fully supported yet by OpenAPI generator. When invoking the openApiGenerate phase, the following message is printed as part of the output:
Generation using 3.1.0 specs is in development and is not officially supported yet. If you would like to expedite development, please consider woking on the open issues in the 3.1.0 project: https://github.com/orgs/OpenAPITools/projects/4/views/1 and reach out to our team on Slack at https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g
This ticket could be considered a sub-task or duplicate of #9083.
For the time being, a helpful workaround could be to use a 3.0.1 OpenAPI spec instead.
looks like it's fixed in the latest master/stable version.
import org.openapitools.client.JSON;
/**
* Pet
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-24T19:41:50.516232800+08:00[Asia/Hong_Kong]", comments = "Generator version: 7.8.0-SNAPSHOT")
public class Pet {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private Long id;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_TAG = "tag";
@SerializedName(SERIALIZED_NAME_TAG)
private String tag;
please give it another try with the latest master/stable version when you've time.
Bug Report Checklist
Description
If you use Openapi 3.1 generator ignors filed types. Just put Object type everywhere.
openapi-generator version
Tested on 6.3.0 - 6.5.0
OpenAPI declaration file content or url
https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.1/webhook-example.yaml
Generation Details
Ignors value types in schemes. Just generates models classes with Object type params instead String, Integer etc
Steps to reproduce
Related issues/PRs
Not found
Suggest a fix
expexted result - generator will use type from spec-yaml file (String , integer, Long etc).
The text was updated successfully, but these errors were encountered: