Dev - Nexus
  1. Dev - Nexus
  2. NEXUS-4134

Documentation for repositories REST XML payload is incorrect.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.0.1
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
      None
    • Global Rank:
      6063
    • Story Points:
      1

      Description

      If you attempt to create a repository using the XML payload described in the documentation it fails, you get error 400. No further information is printed in the log, even at debug level.

      This is due to missing required fields. If you send up all fields that come from GET request it works.

      curl -u admin:admin123 -H "Content-Type: application/xml" http://localhost:8081/nexus/service/local/repositories/releases
      <repository>
        <data>
          <contentResourceURI>http://localhost:8081/nexus/content/repositories/releases</contentResourceURI>
          <id>releases</id>
          <name>Releases</name>
          <provider>maven2</provider>
          <providerRole>org.sonatype.nexus.proxy.repository.Repository</providerRole>
          <format>maven2</format>
          <repoType>hosted</repoType>
          <exposed>true</exposed>
          <writePolicy>ALLOW_WRITE_ONCE</writePolicy>
          <browseable>true</browseable>
          <indexable>true</indexable>
          <notFoundCacheTTL>1440</notFoundCacheTTL>
          <repoPolicy>RELEASE</repoPolicy>
          <downloadRemoteIndexes>false</downloadRemoteIndexes>
          <defaultLocalStorageUrl>file:/Users/rseddon/Nexii/nexus-1801/nexus-professional-webapp-1.8.0.1/./../sonatype-work/nexus/storage/releases/</defaultLocalStorageUrl>
        </data>
      

        Issue Links

          Activity

          Hide
          Tamás Cservenák added a comment -

          This is because of inheritance among RepositoryBaseResource (and it's child) classes. There are 4 "leafs" in class hierarchy (group, shadow, hosted, proxy), and for each payload, 4 different DTO class is used, that all extend the RepositoryBaseResource – which is actually lowest common denominator, hence, is declared on methods signature and is documented by Enunciate (using JAXB).

          Show
          Tamás Cservenák added a comment - This is because of inheritance among RepositoryBaseResource (and it's child) classes. There are 4 "leafs" in class hierarchy (group, shadow, hosted, proxy), and for each payload, 4 different DTO class is used, that all extend the RepositoryBaseResource – which is actually lowest common denominator, hence, is declared on methods signature and is documented by Enunciate (using JAXB).
          Hide
          Tamás Cservenák added a comment -

          This is fundamentally flawed, and sadly there is nothing we can do about it – without reimplementing a new resource that would use one DTO class and avoid using type-info to drive it's behavior.

          Show
          Tamás Cservenák added a comment - This is fundamentally flawed, and sadly there is nothing we can do about it – without reimplementing a new resource that would use one DTO class and avoid using type-info to drive it's behavior.
          Hide
          Igor Fedorenko added a comment -

          Closing issues that have not been updated for over one year. Please reopen if you believe the issue requires further attention.

          Show
          Igor Fedorenko added a comment - Closing issues that have not been updated for over one year. Please reopen if you believe the issue requires further attention.

            People

            • Assignee:
              Unassigned
              Reporter:
              Rich Seddon
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: