mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
[#71358] fixed version read model usage
- improved description of API spec
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user