[#71358] fixed version read model usage

- improved description of API spec
This commit is contained in:
Eric Schubert
2026-02-12 11:05:18 +01:00
parent 10d472052d
commit 887ded5714
8 changed files with 43 additions and 14 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ module McpTools
properties: {
items: {
type: :array,
items: JsonSchemaLoader.new.load("version_model")
items: JsonSchemaLoader.new.load("version_read_model")
}
}
)
@@ -2,7 +2,7 @@
---
type: object
patternProperties:
"^customField\\d+":
"^customField\\d+$":
allOf:
- $ref: "./link.yml"
- description: |-
@@ -2,12 +2,13 @@
---
type: object
patternProperties:
"^customField\\d+":
"^customField\\d+$":
type:
- "null"
- number
- boolean
- string
- object
description: |-
A custom field value, that belongs to a custom field of a simple type:
@@ -40,7 +40,12 @@ properties:
format: date
status:
type: string
description: The current status of the version
description: |-
The current status of the version. This could be:
- *open*: if the version is available to be assigned to work packages in all shared projects
- *locked*: if the version is not finished, but locked for further assignments to work packages
- *closed*: if the version is finished
enum:
- open
- locked
@@ -49,11 +54,12 @@ properties:
type: string
description: |-
The indicator of how the version is shared between projects. This could be:
- *none*: if the version is only available in the defining project
- *descendants*: if the version is shared with the descendants of the defining project
- *hierarchy*: if the version is shared with the descendants and the ancestors of the defining project
- *tree*: if the version is shared with the root project of the defining project and all descendants of the root project
- *system*: if the version is shared globally
- *none*: if the version is only available in the defining project
- *descendants*: if the version is shared with the descendants of the defining project
- *hierarchy*: if the version is shared with the descendants and the ancestors of the defining project
- *tree*: if the version is shared with the root project of the defining project and all descendants of the root project
- *system*: if the version is shared globally
enum:
- none
- descendants
@@ -21,10 +21,32 @@ properties:
format: date
status:
type: string
description: The current status of the version
description: |-
The current status of the version. This could be:
- *open*: if the version is available to be assigned to work packages in all shared projects
- *locked*: if the version is not finished, but locked for further assignments to work packages
- *closed*: if the version is finished
enum:
- open
- locked
- closed
sharing:
type: string
description: The current status of the version
description: |-
The indicator of how the version is shared between projects. This could be:
- *none*: if the version is only available in the defining project
- *descendants*: if the version is shared with the descendants of the defining project
- *hierarchy*: if the version is shared with the descendants and the ancestors of the defining project
- *tree*: if the version is shared with the root project of the defining project and all descendants of the root project
- *system*: if the version is shared globally
enum:
- none
- descendants
- hierarchy
- tree
- system
_links:
type: object
allOf:
@@ -49,7 +49,7 @@ RSpec.describe API::V3::Versions::VersionRepresenter, "rendering" do
end
it "fulfills the documented schema" do
expect(generated).to match_json_schema.from_docs("version_model")
expect(generated).to match_json_schema.from_docs("version_read_model")
end
it { is_expected.to include_json("Version".to_json).at_path("_type") }
@@ -69,7 +69,7 @@ RSpec.describe McpResources::Version, with_flag: { mcp_server: true } do
subject
text_content = parsed_results.fetch("contents").first
version = text_content.fetch("text")
expect(version).to match_json_schema.from_docs("version_model")
expect(version).to match_json_schema.from_docs("version_read_model")
end
context "when the resource is disabled via configuration" do
@@ -78,7 +78,7 @@ RSpec.describe McpTools::SearchVersions, with_flag: { mcp_server: true } do
it "responds with properly formatted versions" do
subject
parsed_results.dig("structuredContent", "items").each do |version|
expect(version.to_json).to match_json_schema.from_docs("version_model")
expect(version.to_json).to match_json_schema.from_docs("version_read_model")
end
end