Skip to content

panic: spec type not supported by libopenapi, sorry #300

@alexanderilyin

Description

@alexanderilyin

It seems that restish does not work with openapi: 3.1.0. I might be wrong tho, still digging.

I'm trying to hack several things together so I have a convenient environment, main parts are:

  • https://world.openfoodfacts.net — Public HTTP API, it's kinda OpenAPI but missing few pieces here and there.
  • restish — best tool in known universe for peeking on HTTP APIs.
  • docs/api/ref/ — directory with API specs which I try to have locally so restish could give me nice CLI UX.

Below are the main steps I'm currently following:

  1. Clone repo with API specs:
git clone https://github.com/openfoodfacts/openfoodfacts-server.git /tmp/openfoodfacts-server
  1. Configure restish to use local specs:
{
  "$schema": "https://rest.sh/schemas/apis.json",
  "openfoodfacts": {
    "base": "https://world.openfoodfacts.net/api/v2",
    "spec_files": ["/workspaces/amp-python/openfoodfacts.yaml"],
    "profiles": {
      "default": {
        "auth": {
          "name": ""
        }
      }
    },
    "tls": {}
  }
}
  1. Watch my hopes and dreams burn:
$ restish openfoodfacts --help
panic: spec type not supported by libopenapi, sorry

goroutine 1 [running]:
github.com/rest-sh/restish/cli.Run()
        /go/pkg/mod/github.com/rest-sh/[email protected]/cli/cli.go:822 +0xf45
main.main()
        /go/pkg/mod/github.com/rest-sh/[email protected]/main.go:40 +0x245

I'm somewhat interested in two options:

  1. Suggestions on where to apply duct tape to make it work at least locally.
  2. Suggestions on how to fix it in upstream.

Meanwhile I will try to downgrade specs to v2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions