mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* Serve /devfile * Implement /devfile endpoints * Load/Save devfile from UI * Required metadata fields in the response * Add an Apply button on 1st tab * Fix: validate new devfile, not previous one * Add generated UI files to gitattributes file * Fix rebase
41 lines
1.1 KiB
Go
Generated
41 lines
1.1 KiB
Go
Generated
/*
|
|
* odo dev
|
|
*
|
|
* API interface for 'odo dev'
|
|
*
|
|
* API version: 0.1
|
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
*/
|
|
|
|
package openapi
|
|
|
|
type DevfilePutRequest struct {
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
// AssertDevfilePutRequestRequired checks if the required fields are not zero-ed
|
|
func AssertDevfilePutRequestRequired(obj DevfilePutRequest) error {
|
|
elements := map[string]interface{}{
|
|
"content": obj.Content,
|
|
}
|
|
for name, el := range elements {
|
|
if isZero := IsZeroValue(el); isZero {
|
|
return &RequiredError{Field: name}
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// AssertRecurseDevfilePutRequestRequired recursively checks if required fields are not zero-ed in a nested slice.
|
|
// Accepts only nested slice of DevfilePutRequest (e.g. [][]DevfilePutRequest), otherwise ErrTypeAssertionError is thrown.
|
|
func AssertRecurseDevfilePutRequestRequired(objSlice interface{}) error {
|
|
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
|
|
aDevfilePutRequest, ok := obj.(DevfilePutRequest)
|
|
if !ok {
|
|
return ErrTypeAssertionError
|
|
}
|
|
return AssertDevfilePutRequestRequired(aDevfilePutRequest)
|
|
})
|
|
}
|