// Error if user tries to specify both builtin version
// and custom schema
Error if user tries to specify both builtin version
and custom schema
// Error if user tries to specify both builtin version // and custom schema
func TestCustomOpenApiFieldBothPathAndVersion(t *testing.T) {
	th := kusttest_test.MakeHarness(t)
	th.WriteK(".", `
resources:
- mycrd.yaml
openapi:
  version: v1.20.4
  path: mycrd_schema.json
`+customSchemaPatch)
	writeCustomResource(th, "mycrd.yaml")
	writeTestSchema(th, "./")
	openapi.ResetOpenAPI()
	err := th.RunWithErr(".", th.MakeDefaultOptions())
	assert.Error(t, err)
	assert.Equal(t,
		"builtin version and custom schema provided, cannot use both",
		err.Error())
}
func TestCustomOpenApiFieldBothPathAndVersion ( t * testing . T ) { th := kusttest_test . MakeHarness ( t ) th . WriteK ( " " , `
resources:
- mycrd.yaml
openapi:
  version: v1.20.4
  path: mycrd_schema.json
` + customSchemaPatch ) writeCustomResource ( th , " " ) writeTestSchema ( th , " " ) openapi . ResetOpenAPI ( ) err := th . RunWithErr ( " " , th . MakeDefaultOptions ( ) ) assert . Error ( t , err ) assert . Equal ( t , " " , err . Error ( ) ) }
Error if user tries to specify both builtin version
and custom schema
Error if user tries to specify both builtin version and custom schema