Skip to content

Problem generate definitions of models #2910

@mickahell

Description

@mickahell

Problem statement

When running the swagger it doesn't generate the full definitions of my models.

Swagger specification

One of my models :

// swagger:model Health
type Health struct {
	// Title of the api page
	// in: string
	Title string `json:"title"`
	// Message of the api
	// in: string
	Message string `json:"message"`
}

Result :

basePath: /
consumes:
  - application/json
definitions:
  Event_Staff:
    x-go-name: Staff
    x-go-package: github.com/ESNFranceG33kTeam/CosmoAppy/modules/event
  GalaxyConf:
    x-go-package: github.com/ESNFranceG33kTeam/CosmoAppy/cocas
  Health:
    x-go-package: github.com/ESNFranceG33kTeam/CosmoAppy/modules/health
host: 127.0.0.1:8080
info:
  description: |-
    the purpose of this application is to provide an application
    that is using plain go code to define an API
  termsOfService: not yet...
  title: CosmoAppy.
  version: 0.0.1
paths:
...

As you can see, the definitions of my models is not details the fields of the structure.
Anyone would have any idea of what I'm doing wrong and how to fix it ?

Steps to reproduce

swagger generate spec -o test/swagger.yaml --scan-models

Environment

swagger version: v0.30.3
go version: go1.19
OS: MacOS


Thanks in advance for your help 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions