8000 generate spec: json.RawMessage doesn't represent the intent. · Issue #1622 · go-swagger/go-swagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
generate spec: json.RawMessage doesn't represent the intent. #1622
Closed
@klauspost

Description

@klauspost

Problem statement

When generating from source, models with a json.RawMessage, it is represented as an array of uint8 values (which is the internal representation of course). Just as a interface{} generates a "type": "object" it would be nice if json.RawMessage did the same.

Swagger specification

The following model is generated:

    "RawMessage": {
      "description": "It implements Marshaler and Unmarshaler and can\nbe used to delay JSON decoding or precompute a JSON encoding.",
      "type": "array",
      "title": "RawMessage is a raw encoded JSON value.",
      "items": {
        "type": "integer",
        "format": "uint8"
      },
      "x-go-package": "encoding/json"
    }

Steps to reproduce

Generate a model with a json.RawMessage field.

Command used here: swagger generate spec -m -i swagger.yaml -o ./swagger.json

Environment

swagger version: SHA-1: 8914a0f (latest master)
go version: 1.10.3
OS: windows/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0