File: alpha.go

package info (click to toggle)
golang-k8s-kube-openapi 0.0~git20211014.b3fe75c-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,880 kB
  • sloc: makefile: 6
file content (36 lines) | stat: -rw-r--r-- 840 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// The package is intended for testing the openapi-gen API rule
// checker. The API rule violations are in format of:
//
// `{rule-name},{package},{type},{(optional) field}`
//
// The checker should sort the violations before
// reporting to a file or stderr.
//
// We have the dummytype package separately from the listtype
// package to test the sorting behavior on package level, e.g.
//
//   -i "./testdata/listtype,./testdata/dummytype"
//   -i "./testdata/dummytype,./testdata/listtype"
//
// The violations from dummytype should always come first in
// report.

package dummytype

// +k8s:openapi-gen=true
type Foo struct {
	Second string
	First  int
}

// +k8s:openapi-gen=true
type Bar struct {
	ViolationBehind bool
	Violation       bool
}

// +k8s:openapi-gen=true
type Baz struct {
	Violation       bool
	ViolationBehind bool
}