Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MODLISTS-129] Move migration request/response types from mod-fqm-manager #68

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@
<generateApiTests>true</generateApiTests>
<generateApiDocumentation>true</generateApiDocumentation>
<generateModels>true</generateModels>
<modelsToGenerate>entityDataType,arrayType,dateType,entityTypeRelation,objectType,nestedObjectProperty,entityTypeColumn,enumType,booleanType,entityType,integerType,openUUIDType,stringType,numberType,rangedUUIDType,valueWithLabel,entityTypeDefaultSort,errors,error,parameters,parameter,resultsetPage,queryDetails,queryIdentifier,sourceColumn,valueSourceApi,columnValues,columnValueGetter,submitQuery,contentsRequest,field,entityTypeSource,entityTypeSourceJoin,stringUUIDType</modelsToGenerate>
<modelsToGenerate>
<!-- the commas at the start and end of each line are load-bearing, as otherwise openapi-generator will include the newline/indentation as part of the model name -->
Copy link
Contributor

Choose a reason for hiding this comment

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

I love the wording here with "load-bearing" commas :D

Copy link
Member Author

Choose a reason for hiding this comment

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

i'm glad there's something to love in that situation, lol

,errors,error,parameters,parameter,resultsetPage,
,entityType,field,entityTypeColumn,entityTypeRelation,entityTypeDefaultSort,sourceColumn,entityTypeSource,entityTypeSourceJoin,
,entityDataType,arrayType,dateType,objectType,enumType,booleanType,integerType,openUUIDType,stringType,numberType,rangedUUIDType,stringUUIDType,
,nestedObjectProperty,valueWithLabel,valueSourceApi,columnValues,columnValueGetter,
,queryDetails,queryIdentifier,
,submitQuery,contentsRequest,fqmMigrateRequest,fqmMigrateResponse,fqmMigrateWarning
</modelsToGenerate>
<generateModelTests>false</generateModelTests>
<generateModelDocumentation>true</generateModelDocumentation>
<generateSupportingFiles>true</generateSupportingFiles>
Expand Down
11 changes: 8 additions & 3 deletions src/main/resources/swagger.api/queryTool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ components:
$ref: schemas/query.json#/SubmitQuery
contentsRequest:
$ref: schemas/query.json#/ContentsRequest

fqmMigrateRequest:
$ref: schemas/fqmMigrateRequest.json
fqmMigrateResponse:
$ref: schemas/fqmMigrateResponse.json

queryResultIds:
type: array
items:
Expand All @@ -375,7 +381,7 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/errors"
$ref: '#/components/schemas/errors'
internalServerErrorResponse:
description: When unhandled exception occurred during code execution, e.g. NullPointerException
content:
Expand All @@ -386,5 +392,4 @@ components:
code: unexpected.error
total_records: 1
schema:
$ref: "#/components/schemas/errors"

$ref: '#/components/schemas/errors'
26 changes: 26 additions & 0 deletions src/main/resources/swagger.api/schemas/fqmMigrateRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Entity Upgrade Request",
"description": "Schema for a request to upgrade an entity payload, including an entity type ID, FQL query, and list of fields.",
"type": "object",
"properties": {
"entityTypeId": {
"description": "ID of the entity type to be upgraded",
"type": "string",
"format": "UUID"
},
"fqlQuery": {
"description": "FQL query string to be upgraded",
"type": "string"
},
"fields": {
"description": "List of fields to be upgraded",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": ["entityTypeId"]
}
33 changes: 33 additions & 0 deletions src/main/resources/swagger.api/schemas/fqmMigrateResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Entity Upgrade Response",
"description": "Schema for a migrated query, with associated entity type, fields, and potential warnings",
"type": "object",
"properties": {
"entityTypeId": {
"description": "ID of the post-upgrade entity type",
"type": "string",
"format": "uuid"
},
"fqlQuery": {
"description": "Post-upgrade FQL query string",
"type": "string"
},
"fields": {
"description": "Post-upgrade list of fields",
"type": "array",
"items": {
"type": "string"
}
},
"warnings": {
"description": "List of warnings issued during the upgrade",
"type": "array",
"items": {
"$ref": "./fqmMigrateWarning.json"
}
}
},
"additionalProperties": false,
"required": ["entityTypeId"]
}
18 changes: 18 additions & 0 deletions src/main/resources/swagger.api/schemas/fqmMigrateWarning.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Entity Upgrade Warning",
"description": "Warnings resulting from a query upgrade",
"type": "object",
"properties": {
"description": {
"description": "Description of the warning",
"type": "string"
},
"type": {
"description": "Type of warning",
"type": "string"
}
},
"additionalProperties": false,
"required": ["description", "type"]
}
Loading