LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

Add optional host field to namespace #91

Closed michael-gillett closed 4 years ago

michael-gillett commented 4 years ago

Onboarding has an internal API with a Reslang definitions, but it is not available through api.liveramp.com. This allows a host field to be specified in namespace to set a different api host.

Example:

namespace scheduled-file-delivery-api {
    title "An API for scheduling file deliveries"
    host "scheduled-file-delivery-api.liveramp.net"
    version 0.1.0
}
michael-gillett commented 4 years ago

My peg.js skills are nonexistent so I couldn't come up with a peg.js definition for a domain. Instead I used the existing description definition which means you can specify a host that isn't valid.

Not sure how much effort it's worth to write a peg.js regex-y definition for it. This regex should work, but I don't think peg.js supports repeats (e.g. {1,61})

njaczko commented 4 years ago

Drive by JFYI: https://github.com/LiveRamp/reslang/issues/85 This issue is going to have to be solved soon (part of unblocking the event bus mvp). It covers a superset of the issue you're having here mike.

Not sure if the syntax you're proposing here is going to changed/unnecessary when server blocks are supported....

make of that what you will! :)

michael-gillett commented 4 years ago

@njaczko Thanks for the heads up, it likely doesn't make sense to put all of that info into namespace so a server resource seems good

liveandrew commented 4 years ago

mike - i think this is covered by the new server block syntax - can you verify and reopen if not https://github.com/LiveRamp/reslang/blob/master/docs/server-blocks.md