mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add missing swagger spec (#175)
* Add missing swagger spec * More cleaning up of the swagger.yml and removing unused structs * Add TaskWrapper
This commit is contained in:
committed by
C Cirello
parent
c95c0dd8f0
commit
e85a31b715
@@ -1,34 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/validate"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
)
|
||||
|
||||
type AppsWrapper struct {
|
||||
Apps []*App `json:"apps"`
|
||||
}
|
||||
|
||||
func (m *AppsWrapper) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateApps(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AppsWrapper) validateApps(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("apps", "body", m.Apps); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
/*NewTasksWrapper new tasks wrapper
|
||||
|
||||
swagger:model NewTasksWrapper
|
||||
*/
|
||||
type NewTasksWrapper struct {
|
||||
|
||||
/* tasks
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Tasks []*NewTask `json:"tasks"`
|
||||
}
|
||||
|
||||
// Validate validates this new tasks wrapper
|
||||
func (m *NewTasksWrapper) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateTasks(formats); err != nil {
|
||||
// prop
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *NewTasksWrapper) validateTasks(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("tasks", "body", m.Tasks); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/validate"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
)
|
||||
|
||||
type RoutesWrapper struct {
|
||||
Cursor string `json:"cursor,omitempty"`
|
||||
Error *ErrorBody `json:"error,omitempty"`
|
||||
Routes []*Route `json:"routes"`
|
||||
}
|
||||
|
||||
func (m *RoutesWrapper) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateRoutes(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *RoutesWrapper) validateRoutes(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("routes", "body", m.Routes); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
)
|
||||
|
||||
/*TaskWrapper task wrapper
|
||||
|
||||
swagger:model TaskWrapper
|
||||
*/
|
||||
type TaskWrapper struct {
|
||||
|
||||
/* task
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Task *Task `json:"task"`
|
||||
}
|
||||
|
||||
// Validate validates this task wrapper
|
||||
func (m *TaskWrapper) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateTask(formats); err != nil {
|
||||
// prop
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TaskWrapper) validateTask(formats strfmt.Registry) error {
|
||||
|
||||
if m.Task != nil {
|
||||
|
||||
if err := m.Task.Validate(formats); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
/*TasksWrapper tasks wrapper
|
||||
|
||||
swagger:model TasksWrapper
|
||||
*/
|
||||
type TasksWrapper struct {
|
||||
|
||||
/* Used to paginate results. If this is returned, pass it into the same query again to get more results.
|
||||
*/
|
||||
Cursor string `json:"cursor,omitempty"`
|
||||
|
||||
/* error
|
||||
*/
|
||||
Error *ErrorBody `json:"error,omitempty"`
|
||||
|
||||
/* tasks
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Tasks []*Task `json:"tasks"`
|
||||
}
|
||||
|
||||
// Validate validates this tasks wrapper
|
||||
func (m *TasksWrapper) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateTasks(formats); err != nil {
|
||||
// prop
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TasksWrapper) validateTasks(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("tasks", "body", m.Tasks); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user