Skip to content

Commit

Permalink
[MODFQMMGR-150] Add nested object types (#36)
Browse files Browse the repository at this point in the history
* [MODFQMMGR-150] Add nested object types

* Actually generate the model 🙃
  • Loading branch information
ncovercash authored Feb 8, 2024
1 parent 805d458 commit 548f6a8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 19 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<generateApiTests>true</generateApiTests>
<generateApiDocumentation>true</generateApiDocumentation>
<generateModels>true</generateModels>
<modelsToGenerate>entityDataType,arrayType,dateType,entityTypeRelation,objectType,entityTypeColumn,enumType,booleanType,entityType,integerType,openUUIDType,stringType,numberType,rangedUUIDType,valueWithLabel,entityTypeDefaultSort,errors,error,parameters,parameter,resultsetPage,queryDetails,queryIdentifier,sourceColumn,columnValues,columnValueGetter,submitQuery,contentsRequest</modelsToGenerate>
<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,columnValues,columnValueGetter,submitQuery,contentsRequest</modelsToGenerate>
<generateModelTests>false</generateModelTests>
<generateModelDocumentation>true</generateModelDocumentation>
<generateSupportingFiles>true</generateSupportingFiles>
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/swagger.api/queryTool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ components:
$ref: schemas/entityDataType.json#/EnumType
objectType:
$ref: schemas/entityDataType.json#/ObjectType
objectTypeContainer:
$ref: schemas/entityDataType.json#/ObjectTypeContainer
nestedObjectProperty:
$ref: schemas/entityDataType.json#/NestedObjectProperty
arrayType:
$ref: schemas/entityDataType.json#/ArrayType
entityTypeDefaultSort:
Expand Down
63 changes: 45 additions & 18 deletions src/main/resources/swagger.api/schemas/entityDataType.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"type": "string"
}
},
"required": [
"dataType"
],
"required": ["dataType"],
"discriminator": {
"propertyName": "dataType"
}
Expand Down Expand Up @@ -79,18 +77,6 @@
}
]
},
"ObjectTypeContainer": {
"type": "object",
"properties": {
"objectDefinition": {
"description": "The entity type describing the complex column when the data type is OBJECT.",
"$ref": "entityType.json#/EntityType"
}
},
"required": [
"objectDefinition"
]
},
"ObjectType": {
"description": "Entity field type defined in https://issues.folio.org/browse/UIPQB-10",
"allOf": [
Expand All @@ -102,6 +88,49 @@
}
]
},
"ObjectTypeContainer": {
"type": "object",
"properties": {
"properties": {
"description": "A list of this object's properties",
"type": "array",
"items": {
"$ref": "entityDataType.json#/NestedObjectProperty"
}
}
},
"required": ["properties"]
},
"NestedObjectProperty": {
"type": "object",
"description": "A property within an object",
"properties": {
"name": {
"description": "The name of the property",
"type": "string"
},
"key": {
"description": "The key of the property inside the object",
"type": "string"
},
"labelAlias": {
"description": "The human-readable label for this property; should be unqualified (e.g. 'Name' instead of 'User's Name')",
"type": "string"
},
"dataType": {
"description": "The data type of the property",
"$ref": "entityDataType.json#/EntityDataType"
},
"values": {
"type": "array",
"description": "Array of values for this column",
"items": {
"$ref": "valueWithLabel.json"
}
}
},
"required": ["name", "key", "dataType"]
},
"ArrayTypeContainer": {
"type": "object",
"properties": {
Expand All @@ -110,9 +139,7 @@
"$ref": "entityDataType.json#/EntityDataType"
}
},
"required": [
"itemDataType"
]
"required": ["itemDataType"]
},
"ArrayType": {
"description": "Entity field type defined in https://issues.folio.org/browse/UIPQB-6",
Expand Down

0 comments on commit 548f6a8

Please sign in to comment.