Uploaded image for project: 'LLM AI Integration'
  1. LLM AI Integration
  2. LLMAI-133

PUT collection REST API returns 500 when rights check method configuration is omitted from request body

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.8
    • 0.7.2
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Summary

      Sending a PUT request to update a collection that has a rights_check_method configured, without including rights_check_method_configuration in the request body, results in a 500 Internal Server Error. The update is completely rejected, even for unrelated fields.

      Steps to reproduce

      1. Ensure a collection with a rights check method exists. In the following, it assumed that a collection "Sandbox" exists and the standard demo Admin user exists.
      2. Send a partial PUT updating only the title:
        curl -u Admin:admin -X PUT -H "Content-Type: application/json" \
        -d '{"title": "Sandbox"}' \
        http://localhost:8080/xwiki/rest/wikis/xwiki/aiLLM/collections/Sandbox
        

      Expected result:

      HTTP 200 with the updated collection object; only the title field is changed, all other properties (including rights_check_method) remain unchanged.

      Actual result:

      HTTP 500 Internal Server Error. Server log shows:

      ERROR .i.r.DefaultCollectionResource - Error updating collection [Sandbox].  
      org.xwiki.contrib.llm.IndexException: Authorization configuration object is not of the correct type [class java.lang.Object]
              at org.xwiki.contrib.llm.internal.DefaultCollection.setAuthorizationConfiguration(DefaultCollection.java:338)
              at org.xwiki.contrib.llm.rest.JSONCollection.applyTo(JSONCollection.java:115)
              at org.xwiki.contrib.llm.internal.rest.DefaultCollectionResource.putCollection(DefaultCollectionResource.java:94

       

      Attachments

        Activity

          People

            MichaelHamann Michael Hamann
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: