-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Description
Description
Generated code for schemas with no defined type is incorrect, because parsing seems to require a type property despite it being optional in the specification (where it defines values that can be of any type).
Swagger-codegen version
2.2.3, 2.3.0-SNAPSHOT
Swagger declaration file content or url
swagger: '2.0'
info:
title: 'map of arbitrary values'
version: '1'
produces: ["application/json"]
paths:
/mapOfAnything:
get:
operationId: mapOfAnything
responses:
default:
schema:
description: 'map of arbitrary values'
type: object
additionalProperties:
description: Any JSON typeCommand line used for generation
./run-in-docker.sh generate -i swagger.yaml -l java
Steps to reproduce
Generate code from the above YAML. Observe that the response is treated as Object instead of Map<String, Object>, despite describing a map.
Related issues/PRs
None found.
Suggest a fix/enhancement
Treat untyped schemas as generically as possible.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels