anancarv / python-artifactory

Typed interactions with the Jfrog Artifactory REST API
MIT License
55 stars 50 forks source link

Unable to save remote nuget repo #106

Closed joshpearce closed 2 years ago

joshpearce commented 2 years ago

When I try to create a new nuget remote repo, I see the following error in Artifactory logs:

Failed creating/replacing repository. Reason: NuGet Repository configuration is missing mandatory field downloadContextPath java.lang.IllegalArgumentException: NuGet Repository configuration is missing mandatory field downloadContextPath

You can see here that the JSON does not nest the nuget properties:

https://www.jfrog.com/confluence/display/JFROG/Repository+Configuration+JSON#RepositoryConfigurationJSON-RemoteRepository

Using this inherited class fixed my issue:

class RemoteRepositoryFixed(RemoteRepository):
    def dict(self):
        d = RemoteRepository.dict(self)
        d['downloadContextPath'] = self.nuget.downloadContextPath
        d['feedContextPath'] = self.nuget.feedContextPath
        d['v3FeedUrl'] = self.nuget.v3FeedUrl
        return d

By the way, thanks for this project!! It looks like a lot of work went into it, and it's been enjoyable to use.