Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec validation failed #374

Open
nbelchug opened this issue Dec 21, 2023 · 0 comments
Open

spec validation failed #374

nbelchug opened this issue Dec 21, 2023 · 0 comments

Comments

@nbelchug
Copy link

What happened:

Impossible to reconstruct API

What you expected to happen:

reconstruct API

How to reproduce it (as minimally and precisely as possible):

A sandbox will be provided to reproduce the issue.

Are there any error messages in API Clarity logs?

(e.g. kubectl logs -n apiclarity --selector=app=apiclarity)

time="2023-12-21T11:37:44Z" level=error msg="provided spec is not valid OpenAPI 3.0: {\"components\":{\"schemas\":{\"amfInstanceId_deregCallbackUri_guami_ratType\":{\"properties\":{\"amfInstanceId\":{\"format\":\"uuid\",\"type\":\"string\"},\"deregCallbackUri\":{\"type\":\"string\"},\"guami\":{\"$ref\":\"#/components/schemas/guami\"},\"ratType\":{\"type\":\"string\"}},\"type\":\"object\"},\"dnnInfo\":{\"properties\":{\"defaultDnnIndicator\":{\"type\":\"boolean\"},\"dnn\":{\"type\":\"string\"}},\"type\":\"object\"},\"guami\":{\"properties\":{\"amfId\":{\"type\":\"string\"},\"plmnId\":{\"$ref\":\"#/components/schemas/plmnId\"}},\"type\":\"object\"},\"plmnId\":{\"properties\":{\"mcc\":{\"type\":\"string\"},\"mnc\":{\"type\":\"string\"}},\"type\":\"object\"},\"subscribedSnssaiInfos\":{\"properties\":{\"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\":{\"$ref\":\"#/components/schemas/{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\"}},\"type\":\"object\"},\"subscribedSnssaiInfos_0\":{\"properties\":{\"subscribedSnssaiInfos\":{\"$ref\":\"#/components/schemas/subscribedSnssaiInfos\"}},\"type\":\"object\"},\"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\":{\"properties\":{\"dnnInfos\":{\"items\":{\"$ref\":\"#/components/schemas/dnnInfo\"},\"type\":\"array\"}},\"type\":\"object\"}}},\"info\":{\"contact\":{\"email\":\"[email protected]\"},\"description\":\"This is a generated Open API Spec\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"https://www.apache.org/licenses/LICENSE-2.0.html\"},\"termsOfService\":\"https://swagger.io/terms/\",\"title\":\"Swagger\",\"version\":\"1.0.0\"},\"openapi\":\"3.0.3\",\"paths\":{\"/nudm-sdm/v2/{param1}/smf-select-data\":{\"get\":{\"parameters\":[{\"in\":\"header\",\"name\":\"3gpp-sbi-sender-timestamp\",\"schema\":{\"type\":\"string\"}},{\"in\":\"header\",\"name\":\"3gpp-sbi-max-rsp-time\",\"schema\":{\"format\":\"int64\",\"type\":\"integer\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/subscribedSnssaiInfos_0\"}}},\"description\":\"response\"},\"default\":{\"description\":\"default\"}}},\"parameters\":[{\"in\":\"path\",\"name\":\"param1\",\"required\":true,\"schema\":{\"type\":\"string\"}}]},\"/nudm-uecm/v1/{param1}/registrations/amf-3gpp-access\":{\"parameters\":[{\"in\":\"path\",\"name\":\"param1\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"put\":{\"parameters\":[{\"in\":\"header\",\"name\":\"3gpp-sbi-sender-timestamp\",\"schema\":{\"type\":\"string\"}},{\"in\":\"header\",\"name\":\"3gpp-sbi-callback\",\"schema\":{\"type\":\"string\"}},{\"in\":\"header\",\"name\":\"3gpp-sbi-max-rsp-time\",\"schema\":{\"format\":\"int64\",\"type\":\"integer\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/amfInstanceId_deregCallbackUri_guami_ratType\"}}}},\"responses\":{\"201\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/amfInstanceId_deregCallbackUri_guami_ratType\"}}},\"description\":\"response\"},\"default\":{\"description\":\"default\"}}}}},\"servers\":[{\"url\":\"http://open5gs-udm-sbi.open5gs:7777\"}]}. spec validation failed. invalid components: schema \"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\": identifier \"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\" is not supported by OpenAPIv3 standard (regexp: \"^[a-zA-Z0-9._-]+$\"). spec validation failed" func=github.com/openclarity/speculator/pkg/spec.LoadAndValidateRawJSONSpec file="/go/pkg/mod/github.com/openclarity/[email protected]/pkg/spec/provided_spec.go:90"
time="2023-12-21T11:37:44Z" level=error msg="Failed to validate the spec. provided spec is not valid OpenAPI 3.0: spec validation failed. invalid components: schema \"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\": identifier \"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\" is not supported by OpenAPIv3 standard (regexp: \"^[a-zA-Z0-9._-]+$\"). spec validation failed\n\nspec: {\"components\":{\"schemas\":{\"amfInstanceId_deregCallbackUri_guami_ratType\":{\"properties\":{\"amfInstanceId\":{\"format\":\"uuid\",\"type\":\"string\"},\"deregCallbackUri\":{\"type\":\"string\"},\"guami\":{\"$ref\":\"#/components/schemas/guami\"},\"ratType\":{\"type\":\"string\"}},\"type\":\"object\"},\"dnnInfo\":{\"properties\":{\"defaultDnnIndicator\":{\"type\":\"boolean\"},\"dnn\":{\"type\":\"string\"}},\"type\":\"object\"},\"guami\":{\"properties\":{\"amfId\":{\"type\":\"string\"},\"plmnId\":{\"$ref\":\"#/components/schemas/plmnId\"}},\"type\":\"object\"},\"plmnId\":{\"properties\":{\"mcc\":{\"type\":\"string\"},\"mnc\":{\"type\":\"string\"}},\"type\":\"object\"},\"subscribedSnssaiInfos\":{\"properties\":{\"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\":{\"$ref\":\"#/components/schemas/{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\"}},\"type\":\"object\"},\"subscribedSnssaiInfos_0\":{\"properties\":{\"subscribedSnssaiInfos\":{\"$ref\":\"#/components/schemas/subscribedSnssaiInfos\"}},\"type\":\"object\"},\"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\":{\"properties\":{\"dnnInfos\":{\"items\":{\"$ref\":\"#/components/schemas/dnnInfo\"},\"type\":\"array\"}},\"type\":\"object\"}}},\"info\":{\"contact\":{\"email\":\"[email protected]\"},\"description\":\"This is a generated Open API Spec\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"https://www.apache.org/licenses/LICENSE-2.0.html\"},\"termsOfService\":\"https://swagger.io/terms/\",\"title\":\"Swagger\",\"version\":\"1.0.0\"},\"openapi\":\"3.0.3\",\"paths\":{\"/nudm-sdm/v2/{param1}/smf-select-data\":{\"get\":{\"parameters\":[{\"in\":\"header\",\"name\":\"3gpp-sbi-sender-timestamp\",\"schema\":{\"type\":\"string\"}},{\"in\":\"header\",\"name\":\"3gpp-sbi-max-rsp-time\",\"schema\":{\"format\":\"int64\",\"type\":\"integer\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/subscribedSnssaiInfos_0\"}}},\"description\":\"response\"},\"default\":{\"description\":\"default\"}}},\"parameters\":[{\"in\":\"path\",\"name\":\"param1\",\"required\":true,\"schema\":{\"type\":\"string\"}}]},\"/nudm-uecm/v1/{param1}/registrations/amf-3gpp-access\":{\"parameters\":[{\"in\":\"path\",\"name\":\"param1\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"put\":{\"parameters\":[{\"in\":\"header\",\"name\":\"3gpp-sbi-sender-timestamp\",\"schema\":{\"type\":\"string\"}},{\"in\":\"header\",\"name\":\"3gpp-sbi-callback\",\"schema\":{\"type\":\"string\"}},{\"in\":\"header\",\"name\":\"3gpp-sbi-max-rsp-time\",\"schema\":{\"format\":\"int64\",\"type\":\"integer\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/amfInstanceId_deregCallbackUri_guami_ratType\"}}}},\"responses\":{\"201\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/amfInstanceId_deregCallbackUri_guami_ratType\"}}},\"description\":\"response\"},\"default\":{\"description\":\"default\"}}}}},\"servers\":[{\"url\":\"http://open5gs-udm-sbi.open5gs:7777\"}]}" func="github.com/openclarity/speculator/pkg/spec.(*Spec).GenerateOASJson" file="/go/pkg/mod/github.com/openclarity/[email protected]/pkg/spec/spec.go:285"
time="2023-12-21T11:37:44Z" level=error msg="Failed to apply the approved review. failed to apply approved review for spec: open5gs-udm-sbi.open5gs:7777. failed to generate Open API Spec. failed to validate the spec. provided spec is not valid OpenAPI 3.0: spec validation failed. invalid components: schema \"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\": identifier \"{\\n\\t\\\\\\\"sst\\\\\\\":\\t1,\\n\\t\\\\\\\"sd\\\\\\\":\\t\\\\\\\"111111\\\\\\\"\\n}\" is not supported by OpenAPIv3 standard (regexp: \"^[a-zA-Z0-9._-]+$\"). spec validation failed" func="github.com/openclarity/apiclarity/backend/pkg/rest.(*Server).PostAPIInventoryReviewIDApprovedReview" file="/build/backend/pkg/rest/review_controller.go:66"
time="2023-12-21T11:37:45Z" level=error msg="BFLA error: unable to process trace: event 124913 cannot resolve to a spec path" func=github.com/openclarity/apiclarity/backend/pkg/modules/internal/bfla/bfladetector.NewBFLADetector.func1 file="/build/backend/pkg/modules/internal/bfla/bfladetector/learn_and_detect_bfla.go:127"

Anything else we need to know?:

Environment:

  • Kubernetes version Client Version: v1.27.3
  • Istio version: 1.20.0
  • APIClarity version: Version: v0.14.5, Commit: 26129dd
  • Cloud provider or hardware configuration: Null
  • Others: Null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant