Skip to content

Run-time error on models containing map[string]interface{} #24

@Arc-Calem

Description

@Arc-Calem

I encounter a runtime error whenever I try to document a model with a map[string]interface{} field:

In Main:

api.Get(apiV1PathPrefix+"/my-route"). HasRequestModel(rest.ModelOf[model.MyRouteRequest]()). HasResponseModel(http.StatusInternalServerError, rest.ModelOf[model.MyRouteRequest]()). HasResponseModel(http.StatusInternalServerError, rest.ModelOf[respond.Error]())

The model:

type MyRouteRequest struct { Id string json:"Id,omitempty" OtherField stringjson:"otherField,omitempty" Text stringjson:"text" binding:"required" Extra map[string]interface{}json:"-" // Field that results in runtime error }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions