Skip to content

support array of pointers Model composition in response #1075

@wu0407

Description

@wu0407

Is your feature request related to a problem? Please describe.
Support array of pointers for objects as nested response. May be that is no pointless, it can work on array of object. but it diffrent from the code.
struct defind:

type ResponsePaginated struct {
	Count int64 `json:"count"`
	BaseHttpResponse
}

type BaseHttpResponse struct {
    Code         int         `json:"error_code" yaml:"error_code"`                   
    ErrorMessage string      `json:"error_message,omitempty" yaml:"error_message,omitempty"` 
    Data         interface{} `json:"data,omitempty" yaml:"data,omitempty"`            
    ErrorDetail  interface{} `json:"error_detail,omitempty" yaml:"error_detail,omitempty"`  
}

the annotation of response:

@success      200  {object}  httptool.ResponsePaginated{data=[]*coreapi.Pod}  "pod list"

executing init return invalid type: httptool.ResponsePaginated{data=[]

Describe the solution you'd like
generate docs sucuccess

Describe alternatives you've considered
current the solution is replace array of pointers to array of object.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions