-
Bug
-
Resolution: Done
-
Major
-
2.11.2 GA
-
False
-
None
-
False
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
-
Current behaviour:
When using Active Docs CRD to create a spec with OAS 3.0.X that contains the empty field content { } under the response object the operator crashes although the spec is created in the admin portal.
The operator logs shows the following:
E0310 12:34:26.431989 1 runtime.go:76] Observed a panic: cannot handle unexported field at {*openapi3.Swagger}.Components.Schemas["ApiResponse"].Value.compiledPattern: "github.com/getkin/kin-openapi/openapi3".Schema consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported goroutine 589 [running]: k8s.io/apimachinery/pkg/util/runtime.logPanic(0x178baa0, 0xc002668c20) /remote-source/deps/gomod/pkg/mod/k8s.io/apimachinery@v0.18.6/pkg/util/runtime/runtime.go:74 +0xa3
Desired behaviour:
Avoid the operator to crash when the empty value is present and display a warning or error.
Additional notes:
- The ActiveDocOpenAPIRefSpec points out that the supported OpenAPI version is 3.0.2, however it works for 3.0.0 & 3.0.1 versions as well without the empty field content { }.
- The empty field content { } is added when converting the spec from v2 to openapi 3 with the Swagger editor. The same file used in another editor does not use the field content { }.
- The content field does not seem a difference between OAS versions 3.0.0, 3.0.1 & 3.0.2 and the specification states that should be a string.