Code Monkey home page Code Monkey logo

Comments (4)

usarid avatar usarid commented on May 21, 2024

Is this an error in the spec somewhere, or a restriction you want to add, or something else?

On Mon, Oct 28, 2013 at 4:05 PM, Damian Martinez Gelabert
[email protected] wrote:

baseUri's should not end in slashes (unless they are meant to be there specifically), because they result in double slashes at the beginning of resource URIs.

Reply to this email directly or view it on GitHub:
#12

from raml-spec.

dmartinezg avatar dmartinezg commented on May 21, 2024

There was a discussion in projects using RAML, that since the JS parser does not strip ending slashes from the baseUri, when consumers want to use the output, resource URLs end up with double slashes.

People have asked that we mandate that RAML processors strip ending slashes from the baseUri. This issue is to at least remove it from the examples.

from raml-spec.

dmartinezg avatar dmartinezg commented on May 21, 2024

I just pushed 4421bfe with this change.

But we still need to discuss whether RAML should mandate that processors strip trailing slashes from the baseUri or resource URLs, etc.

from raml-spec.

usarid avatar usarid commented on May 21, 2024

I don't know about mandating its removal, as it's a valid albeit odd URL. One place you see this is in proxy usecases, where the URL of the call to be proxied is appended to the proxy's URL.

Amusingly, Tim Berners-Lee even expressed regret at having double slashes in 'http://' (http://www.zdnet.com/blog/igeneration/double-slash-in-web-addresses-a-bit-of-a-mistake/3090) but it's too late for that right now.

But perhaps we can indicate in the spec that processors should warn about it as a likely source of errors.

The ultimate interpretation of double slashes is up to the server implementing the API. If this were important enough we could find some way to indicate in a RAML spec that a specific API will treat consecutive slashes as a single slash, or that it will treat them as significant, but I'm not sure it's important enough.

from raml-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.