Giter Site home page Giter Site logo

getReference error with 404 about octokit.js HOT 7 CLOSED

iamsk avatar iamsk commented on May 20, 2024
getReference error with 404

from octokit.js.

Comments (7)

iamsk avatar iamsk commented on May 20, 2024
 *  - refs (String): Required. String of the name of the fully qualified reference (ie: refs/heads/master). If it doesn’t start with ‘refs’ and have at least two slashes, it will be rejected. 

I tested, this should be heads/master, not refs/heads/master, so, pls update this note.

from octokit.js.

mikedeboer avatar mikedeboer commented on May 20, 2024

How strange!! The docs clearly state that the refs part is absolutely required: http://developer.github.com/v3/git/refs/ !

Do you have a reaction from the github devs that can make me feel sure that removing this from the docs is legit?

from octokit.js.

iamsk avatar iamsk commented on May 20, 2024

Maybe I didn't express clearly, I mean: when I set 'refs/heads/master' for key:ref, I opend the debug, and find: GET xxx/git/refs/refs/heads/master, I mean you have auto added refs in url or I make a fuss;)

from octokit.js.

mikedeboer avatar mikedeboer commented on May 20, 2024

Ah! I see what you mean now... in the api/v3.0.0/routes.json file you can see the definition for this call:

        "get-reference": {
            "url": "/repos/:user/:repo/git/refs/:ref",
            "method": "GET",
            "params": {
                "$user": null,
                "$repo": null,
                "$ref": null
            }
        },

You can see that the url is formatted like /repos/:user/:repo/git/refs/:ref so if you remove refs from the url, it'll be fine. I will update the documentation, as it makes more sense to specify the Git root instead of making you prepend refs/ in front of it.

from octokit.js.

mikedeboer avatar mikedeboer commented on May 20, 2024

or what do you think the best change to fix this should be? removing refs from the url in the definition or removing it from the documentation?

from octokit.js.

iamsk avatar iamsk commented on May 20, 2024

I think getReference(or other related) has expressed the meaning of refs, so as before, just update the doc will be ok:)

from octokit.js.

mikedeboer avatar mikedeboer commented on May 20, 2024

fixed in the docs. thanks for reporting this!

from octokit.js.

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.