Closed antoineco closed 6 years ago
additionalProperties is only supported for nested schemas.
additionalProperties
I would expect top-level schemas to also support additionalProperties.
This should be a simple addition to #40, I'm working on it.
Issue description
additionalProperties
is only supported for nested schemas.example
```json { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://example.com/parameters.jschema", "title": "parameters", "type": "object", "properties": { "field": { "type": "object", "additionalProperties": { "type": "string" } } } } ``` generates ```golang package main // Parameters type Parameters struct { Field map[string]string `json:"field,omitempty"` } ```I would expect top-level schemas to also support
additionalProperties
.example
```json { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://example.com/parameters.jschema", "title": "parameters", "type": "object", "additionalProperties": { "type": "string" } } ``` generates ```golang package main /* expected */ // Root /* // Field */ type Root string /* type Field map[string]string */ ```