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
swagger: "2.0"info:
version: 1.0.0title: Swagger Petstoredescription: > A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specificationconsumes:
- application/jsonproduces:
- application/jsonpaths:
/post:
get:
responses:
"200":
description: pet responseschema:
type: arrayitems:
$ref: "#/definitions/Post"definitions:
Post:
type: objectproperties:
title:
type: stringcustomData:
type: objectadditionalProperties:
type: object
I found that adding Object as a primitive type in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java:114 produces the correct behaviour:
languageSpecificPrimitives = Sets.newHashSet(
"Object", // added as a primitive type"String",
"bool",
"int",
"num",
"double",
"dynamic"
);
Bug Report Checklist
Description
Generation produces a compiler error because
Map<String, Object>
attributes are deserialized withObject.mapFromJson
method that doesn't exist:openapi-generator version
Version 5.1.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
#7850
#8179
Suggest a fix
I found that adding
Object
as a primitive type inmodules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java:114
produces the correct behaviour:And generated model:
The text was updated successfully, but these errors were encountered: