component.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. Copyright 2021 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package spec3
  14. import "k8s.io/kube-openapi/pkg/validation/spec"
  15. // Components holds a set of reusable objects for different aspects of the OAS.
  16. // All objects defined within the components object will have no effect on the API
  17. // unless they are explicitly referenced from properties outside the components object.
  18. //
  19. // more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#componentsObject
  20. type Components struct {
  21. // Schemas holds reusable Schema Objects
  22. Schemas map[string]*spec.Schema `json:"schemas,omitempty"`
  23. // SecuritySchemes holds reusable Security Scheme Objects, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#securitySchemeObject
  24. SecuritySchemes SecuritySchemes `json:"securitySchemes,omitempty"`
  25. // Responses holds reusable Responses Objects
  26. Responses map[string]*Response `json:"responses,omitempty"`
  27. // Parameters holds reusable Parameters Objects
  28. Parameters map[string]*Parameter `json:"parameters,omitempty"`
  29. // Example holds reusable Example objects
  30. Examples map[string]*Example `json:"examples,omitempty"`
  31. // RequestBodies holds reusable Request Body objects
  32. RequestBodies map[string]*RequestBody `json:"requestBodies,omitempty"`
  33. // Links is a map of operations links that can be followed from the response
  34. Links map[string]*Link `json:"links,omitempty"`
  35. // Headers holds a maps of a headers name to its definition
  36. Headers map[string]*Header `json:"headers,omitempty"`
  37. // all fields are defined at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#componentsObject
  38. }
  39. // SecuritySchemes holds reusable Security Scheme Objects, more at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#securitySchemeObject
  40. type SecuritySchemes map[string]*SecurityScheme