Add new structures for OpenAPI/UI enhancements (#6931)

This commit is contained in:
Jim Kalafut
2019-06-19 16:48:58 -07:00
committed by GitHub
parent 3cad184ca1
commit 76b551f818
2 changed files with 34 additions and 0 deletions

View File

@@ -112,6 +112,10 @@ type Path struct {
// be automatically line-wrapped at 80 characters.
HelpSynopsis string
HelpDescription string
// DisplayAttrs provides hints for UI and documentation generators. They
// will be included in OpenAPI output if set.
DisplayAttrs *DisplayAttributes
}
// OperationHandler defines and describes a specific operation handler.
@@ -148,6 +152,32 @@ type OperationProperties struct {
// Deprecated indicates that this operation should be avoided.
Deprecated bool
// DisplayAttrs provides hints for UI and documentation generators. They
// will be included in OpenAPI output if set.
DisplayAttrs *DisplayAttributes
}
type DisplayAttributes struct {
// Name is the name of the field suitable as a label or documentation heading.
Name string `json:"name,omitempty"`
// Value is a sample value to display for this field. This may be used
// to indicate a default value, but it is for display only and completely separate
// from any Default member handling.
Value interface{} `json:"value,omitempty"`
// Sensitive indicates that the value should be masked by default in the UI.
Sensitive bool `json:"sensitive,omitempty"`
// Navigation indicates that the path should be available as a navigation tab
Navigation bool `json:"navigation,omitempty"`
// Group is the suggested UI group to place this field in.
Group string `json:"group,omitempty"`
// Action is the verb to use for the operation.
Action string `json:"action,omitempty"`
}
// RequestExample is example of request data.