Skip to content

Skip optional pointer dont work with x-go-type #1195

@Amf1k

Description

@Amf1k

I want to use x-go-type and x-go-type-skip-optional-pointer for change my optional type to null type.
For example

    AuthResponse:
      type: object
      required:
        - user_phone
      properties:
        auth_hash:
          type: string
          x-go-type: null.String
          x-go-type-skip-optional-pointer: true
        user_phone:
          type: string
          pattern: ^\+(\d){5,25}$
          format: phone
          description: Phone number

i expect to see

type AuthResponse struct {
	AuthHash null.String `json:"auth_hash"`
	UserPhone string `json:"user_phone"`
}

but I get

type AuthResponse struct {
	AuthHash *null.String `json:"auth_hash"`
	UserPhone string `json:"user_phone"`
}

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