go-swagger3 icon indicating copy to clipboard operation
go-swagger3 copied to clipboard

Ref for maps object does not get created

Open Keithwachira opened this issue 2 months ago • 0 comments

If you have a struct that has map with struct values, the swagger generated does not reference the AccessDefinition.

type Policys struct {	
AccessRights                  map[string]AccessDefinitions      `bson:"access_rights" json:"access_rights"`
}

type AccessDefinitions struct {
	Name string `json:"name"`
}

This is what is produced instead of using ref to reference the already created AccessDefinitions :

  schemas:
    AccessDefinitions:
      properties:
        name:
          type: string
      type: object
    Policys:
      properties:
        access_rights:
          properties:
            key:
              properties:
                name:
                  type: string
              type: object
          type: object
      type: object ```

Keithwachira avatar May 06 '24 06:05 Keithwachira