open-rpc / playground

A place to play around with OpenRPC. https://playground.open-rpc.org
https://playground.open-rpc.org
Apache License 2.0
40 stars 25 forks source link

Relative URL support in server object #558

Open siy opened 3 years ago

siy commented 3 years ago

Following specification:

{
  "openrpc": "1.2.4",
  "info": {
    "title": "",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/path"
    }
  ],
  "methods": []
}

Triggers following validation error in playground:9:14 - String is not a URI: URI with a scheme is expected.

According to specification, the URL may be relative:

REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. Server Variables are passed into the Runtime Expression to produce a server URL.

So, I'd expect that relative URL should be accepted here.

BelfordZ commented 1 year ago

Thanks for the issue. You are totally right, and the issue fundamentally exists here.