Skip to content

JSON Schema in swagger API response #2821

@rupinder10

Description

@rupinder10

I have an API that returns a body that corresponds to a JSON Schema, The JSON schema structure is included in the API spec file. But when I try to generate the client I get the following error:

name field ArraySchema
package field models
creating generated file "array_schema.go" in "models" as definition
executed template asset:model
source formatting failed on template-generated source ("models\array_schema.go" for definition). Check that your template produces valid code
unformatted generated source "array_schema.go" has been dumped for template debugging purposes. DO NOT build on this source!
source formatting on generated source "definition" failed: models\array_schema.go:118:34: expected ';', found string (and 10 more errors)

Swagger specification

ServiceManagementBody.zip

Steps to reproduce

run
swagger genereate client -f ServiceManagementBody.json -A client

Environment

swagger version: 2.0
go version: 1.18.4
OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions