swagger-api/swagger-codegen

[golang] Default to pointers for non-primitive types

Open

#2330 aperta il 7 mar 2016

Vedi su GitHub
 (14 commenti) (0 reazioni) (0 assegnatari)HTML (5474 fork)batch import
Client: GoEnhancement: GeneralGeneral: Discussionhelp wanted

Metriche repository

Star
 (12.701 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

It generates code like this currently:

type JobWrapper struct {
    Job  Job  `json:"job,omitempty"`
}

Same with slices and what not.

It would be nice (and probably what most people would want) to have it use pointers, eg:

type JobWrapper struct {
    Job *Job  `json:"job,omitempty"`
}

Guida contributor