Skip to content

Order of the properties in generated models are coming in sorted way.. Couldn't able to retain the original order given in Spec. #1607

@suppula-apptio

Description

@suppula-apptio

The order of the properties in my spec file looks like this

User:
  type: object
  properties:
    id:
      type: integer
      format: int64
    frontdoor_user_id:
      type: string
    frontdoor_login:
      type: string
    email:
      type: string
    full_name:
      type: string
    default_dimension_filter_set_id:
      type: integer
      format: int64
    shared_dimension_filter_set_ids:
      type: array
      items:
        type: integer
        format: int64

but the corresponding model class which is generated looks like this

type User struct {

DefaultDimensionFilterSetId *int64 `json:"default_dimension_filter_set_id,omitempty"`

Email *string `json:"email,omitempty"`

FrontdoorLogin *string `json:"frontdoor_login,omitempty"`

FrontdoorUserId *string `json:"frontdoor_user_id,omitempty"`

FullName *string `json:"full_name,omitempty"`

Id *int64 `json:"id,omitempty"`

SharedDimensionFilterSetIds *[]int64 `json:"shared_dimension_filter_set_ids,omitempty"`

}

We want the order given in spec file to be remain same. I didn't find any config or info regarding this. Can any one have a look..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions