diff --git a/build/app/models/post_params_body.go b/build/app/models/post_params_body.go index 8b5ab29..c5e1c6d 100644 --- a/build/app/models/post_params_body.go +++ b/build/app/models/post_params_body.go @@ -12,7 +12,6 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // PostParamsBody post params body @@ -21,8 +20,7 @@ import ( type PostParamsBody struct { // the filename of the output spreadsheet - // Required: true - OutFilename *string `json:"out-filename"` + OutFilename *string `json:"out-filename,omitempty"` // Array of worksheets to create in spreadsheet Sheets []*PostParamsBodySheetsItems `json:"sheets"` @@ -32,10 +30,6 @@ type PostParamsBody struct { func (m *PostParamsBody) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateOutFilename(formats); err != nil { - res = append(res, err) - } - if err := m.validateSheets(formats); err != nil { res = append(res, err) } @@ -46,15 +40,6 @@ func (m *PostParamsBody) Validate(formats strfmt.Registry) error { return nil } -func (m *PostParamsBody) validateOutFilename(formats strfmt.Registry) error { - - if err := validate.Required("out-filename", "body", m.OutFilename); err != nil { - return err - } - - return nil -} - func (m *PostParamsBody) validateSheets(formats strfmt.Registry) error { if swag.IsZero(m.Sheets) { // not required return nil diff --git a/build/app/restapi/embedded_spec.go b/build/app/restapi/embedded_spec.go index 769c1be..69415d9 100644 --- a/build/app/restapi/embedded_spec.go +++ b/build/app/restapi/embedded_spec.go @@ -67,9 +67,6 @@ func init() { "in": "body", "schema": { "type": "object", - "required": [ - "out-filename" - ], "properties": { "out-filename": { "description": "the filename of the output spreadsheet", @@ -397,9 +394,6 @@ func init() { }, "postParamsBody": { "type": "object", - "required": [ - "out-filename" - ], "properties": { "out-filename": { "description": "the filename of the output spreadsheet", diff --git a/readme.md b/readme.md index 0b08632..d527f40 100644 --- a/readme.md +++ b/readme.md @@ -117,7 +117,7 @@ functions: | Name | Type | Go type | Required | Default | Description | Example | |------|------|---------|:--------:| ------- |-------------|---------| -| out-filename | string| `string` | ✓ | `"output.xlsx"`| the filename of the output spreadsheet | | +| out-filename | string| `string` | | `"output.xlsx"`| the filename of the output spreadsheet | | | sheets | [][PostParamsBodySheetsItems](#post-params-body-sheets-items)| `[]*PostParamsBodySheetsItems` | | | Array of worksheets to create in spreadsheet | | diff --git a/swagger.yaml b/swagger.yaml index 64d260a..32f5269 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -55,8 +55,8 @@ paths: in: body schema: type: object - required: - - out-filename + #required: + # - out-filename properties: out-filename: type: string