solo-io / gloo-portal-issues

Public tracker for issues related to Gloo Portal
https://docs.solo.io/gloo-portal/latest/
1 stars 3 forks source link

ApiProduct not resolving ApiDoc operations #24

Closed bpotaczek closed 3 years ago

bpotaczek commented 3 years ago

When creating an ApiProduct and ApiDoc through a custom helm chart, the operations on the ApiDoc do not get resolved and the DevPortal throws an exception when trying to access it. If I manually create an ApiProduct using the same ApiDoc everything works well. I also verified that this still occurs even if the ApiDoc previously exists.

Helm chart generated relevant yaml

spec:
  apis:
  - apiDoc:
      name: sampleapidoc
      namespace: gloo-system
    openApi:
      operations:
      - {}
  defaultRoute:
    routeRef:
      name: sampleapiroute
      namespace: gloo-system
  displayInfo:
    title: SampleApp
    version: "1.0"
  domains:
  - example.com
  publishRoutes: false

Manually created ApiProduct relevant yaml

  spec:
    apis:
    - apiDoc:
        name: anothersampleapidoc
        namespace: gloo-system
      openApi:
        operations:
        - id: Search_GetShipFromOptions
        - id: Search_SearchDocuments
        - id: User_GetCurrentUser
    displayInfo:
      title: test
      version: "1"
    domains:
    - example.com
    publishRoutes: true

Kubernetes status exception

status:
  modifiedDate: "2020-12-18T14:40:20.917208286Z"
  observedGeneration: "3"
  observedLabels:
    app.kubernetes.io/managed-by: Helm
    gloo-portal: example.com
  reason: 'cannot construct merged OpenAPI Schema: did not find the following operations:
    []'
lgadban commented 3 years ago

This happens when the openApi is present but empty:

    openApi:
      operations:
      - {}

Maybe we should confirm and clarify that this field is intended to be optional?

bpotaczek commented 3 years ago

That was the issue, I removed that empty field and everything worked fine. A note in documentation or a different exception would probably help. I would think that could also just always be overridden unless it is setup so we can manually add some operations with the api document.

lgadban commented 3 years ago

Reopening so we can decide how to appropriately document the behavior of this field

chrisgaun commented 3 years ago

Triaging to look into better documentation for next release.

marcogschmidt commented 3 years ago

Documentation for this field has been improved and will be released with version 0.5.1.