Giter VIP home page Giter VIP logo

Comments (5)

anh-duc-le avatar anh-duc-le commented on September 6, 2024

The repository json actually has a property called slug.

For my own project I use a custom Repository POCO for this.

namespace BitbucketPocos
{
    public class Repository
    {
        public Project project { get; set; }
        public string scm { get; set; }
        public bool? has_wiki { get; set; }
        public string description { get; set; }
        public Links links { get; set; }
        public string fork_policy { get; set; }
        public string language { get; set; }
        public string created_on { get; set; }
        public string full_name { get; set; }
        public bool? has_issues { get; set; }
        public Owner owner { get; set; }
        public string updated_on { get; set; }
        public ulong? size { get; set; }
        public bool? is_private { get; set; }
        public string name { get; set; }
        public string uuid { get; set; }
        public string slug { get; set; }
    }
}

Meanwhile you could also translate the repository to a slug using the code I used in this PR here: https://github.com/MitjaBezensek/SharpBucket/pull/70/files

from sharpbucket.

asherber avatar asherber commented on September 6, 2024

@mnivet Now that Repository has a slug property, should this be cleaned up? Looking at the API, it seems that all of the repo methods want the slug, not the name. Probably all of the parameter names should be changed from repository to slug or repositorySlug to make this clear, and the methods themselves should use the slug property. I can work on a PR.

from sharpbucket.

asherber avatar asherber commented on September 6, 2024

Actually, the API can take the slug or the {UUID}.

from sharpbucket.

mnivet avatar mnivet commented on September 6, 2024

When you want to create a new repository (which is the goal of PostRepository) you can't know the UUID, and it's not your duty to guess how names should be transformed to be a valid slug

The pull request #70 done by @anh-duc-le is now re-integrated and do what was needed :
transform the repository name into a slug (code that is called behind the PostRepository method)

So maybe there is still some clean up re-factoring to perform to rename parameter names from repository to repositorySlug like you suggest @asherber
But since the fix is re-integrated let's close that issue and I let you open another one if you think that doing some parameter renaming is really necessary

from sharpbucket.

asherber avatar asherber commented on September 6, 2024

Thanks, I'll take a closer look at the code, but it seems to me that the RepositoryResource methods could all do with a little cleanup to make their intent cleaner.

from sharpbucket.

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.