Skip to content

SOLR-18152: improve body format OpenAPI annotations to fully communicate SchemaDesigner API - #4819

Open
epugh wants to merge 7 commits into
apache:mainfrom
epugh:SOLR-18152-improve-response-formats
Open

SOLR-18152: improve body format OpenAPI annotations to fully communicate SchemaDesigner API#4819
epugh wants to merge 7 commits into
apache:mainfrom
epugh:SOLR-18152-improve-response-formats

Conversation

@epugh

@epugh epugh commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-18152

Description

During integration of SchemaDesigner V2 APIS into Admin UI, it was flagged that we don't properly document the addField / add-field commands.

Before today's fix, the generated JS/SolrJ clients would have sent {"addField": {...}} (camelCase) , but the server doesn't consume that, it consumes add-field.

Solution

Now we do:

curl -X POST "http://localhost:8983/api/schema-designer/mySchema?schemaVersion=3" \
  -H "Content-Type: application/json" \
  -d '{
        "add-field": {
          "name": "keywords",
          "type": "string",
          "stored": true,
          "indexed": true
        }
      }'

This applies to add-dynamic-field, add-copy-field, add-field-type as well!

Tests

Manual and unit

@epugh epugh changed the title SOLR-18152: improve response formats SOLR-18152: improve body format OpenAPI annotations Aug 26, 2026
@epugh
epugh requested a review from gerlowskija August 26, 2026 15:50
@epugh epugh changed the title SOLR-18152: improve body format OpenAPI annotations SOLR-18152: improve body format OpenAPI annotations to fully communicate SchemaDesigner API Aug 27, 2026

@gerlowskija gerlowskija left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@epugh

epugh commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Woot! thanks @gerlowskija this unblocks the last steps in SchemaDesigner to v2 work!

@epugh epugh added this to the 10.x milestone Sep 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The template change can generate references to nonexistent Java model members.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Improves Schema Designer OpenAPI contracts and generated-client request handling.

Changes:

  • Exposes kebab-case add-operation keys.
  • Documents dynamic request properties.
  • Updates generated SolrJ setters and round-trip coverage.
File summaries
File Description
solr/solrj/src/resources/java-template/api.mustache Updates generated request setters.
solr/core/src/test/org/apache/solr/handler/designer/TestSchemaDesignerSolrJ.java Exercises dynamic update properties.
solr/api/src/java/org/apache/solr/client/api/model/UpsertFieldTypeOperation.java Documents open-ended field-type attributes.
solr/api/src/java/org/apache/solr/client/api/model/UpsertFieldOperation.java Documents open-ended field attributes.
solr/api/src/java/org/apache/solr/client/api/model/UpsertDynamicFieldOperation.java Documents open-ended dynamic-field attributes.
solr/api/src/java/org/apache/solr/client/api/model/SchemaDesignerUpdateRequestBody.java Exposes arbitrary update properties in OpenAPI.
solr/api/src/java/org/apache/solr/client/api/model/SchemaDesignerAddRequestBody.java Exposes kebab-case operation names.
solr/api/src/java/org/apache/solr/client/api/endpoint/SchemaDesignerApi.java Enables generated dynamic-property setters.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread solr/solrj/src/resources/java-template/api.mustache
@epugh

epugh commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Okay, once I get a good CI build I plan on merging htis.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The generated JavaScript add-field regression path lacks automated coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 16/16 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +698 to +700
SchemaDesignerV2.addSchemaObject($scope.currentSchema, {
schemaVersion: $scope.schemaVersion,
schemaDesignerAddRequestBody: addData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants