8000 How to generate a correct struct file name from "#/definitions/IPAM" · Issue #1344 · go-swagger/go-swagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
How to generate a correct struct file name from "#/definitions/IPAM" #1344
Closed
@allencloud

Description

@allencloud

Problem statement

Hi, All,

I ran into one situation that in my swagger.yml, I have defined an object IPAM in https://github.com/alibaba/pouch/blob/master/apis/swagger.yml#L1713-L1726:

  IPAM:
    type: "object"
    description: "represents IP Address Management"
    properties:
      Driver:
        type: "string"
      Options:
        type: "object"
        additionalProperties:
          type: "string"
      Config:
        type: "array"
        items:
          $ref: '#/definitions/IPAMConfig'

When generating a file, a file named ip_a_m.go is generated, see https://github.com/alibaba/pouch/blob/master/apis/types/ip_a_m.go.

I do not think the file name ip_a_m.go is what I want.

So, could I customize the file name in some places, like setting something to generate a file named IPAM.go?

/cc @rudyfly @CodeJuan

Swagger specification

See https://github.com/alibaba/pouch/blob/master/apis/swagger.yml

Steps to reproduce

NONE

Environment

swagger version: version: 0.12.0
go version: go version go1.9.1 darwin/amd64
OS: Darwin AllenSundeMacBook-Pro.local 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementswagRelates to github.com/go-openapi/swag

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0