Skip to main content

Dto

Description

Data Transfer Object used to carry data between layers, especially between the Application layer and the API/Presentation layer.

Definition Schema

The definition for a dto component expects the following structure:

{
"$defs": {
"DtoPropertyDefinitionDomainInputDTO": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
},
"required": {
"title": "Required",
"type": "boolean"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Title"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"default_value_str": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Default Value Str"
},
"ui_field_hints": {
"anyOf": [
{
"$ref": "#/$defs/UiFieldExtensionDomainInputDTO"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"name",
"type",
"required"
],
"title": "DtoPropertyDefinitionDomainInputDTO",
"type": "object"
},
"DtoSchemaUiHintsDomainInputDTO": {
"properties": {
"generate_ui_form": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Generate Ui Form"
},
"field_extensions": {
"additionalProperties": {
"$ref": "#/$defs/UiFieldExtensionDomainInputDTO"
},
"title": "Field Extensions",
"type": "object"
},
"example": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Example"
}
},
"title": "DtoSchemaUiHintsDomainInputDTO",
"type": "object"
},
"UiFieldExtensionDomainInputDTO": {
"properties": {
"ui_component": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Component"
},
"ui_order": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Order"
},
"ui_label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Label"
},
"ui_placeholder": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Placeholder"
},
"ui_read_only_on_create": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Read Only On Create"
},
"ui_read_only_on_update": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Read Only On Update"
},
"ui_form_group": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Form Group"
},
"foreign_key_resource_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Foreign Key Resource Path"
},
"foreign_key_option_value_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Foreign Key Option Value Key"
},
"foreign_key_option_label_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Foreign Key Option Label Key"
},
"formlist_item_schema_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Formlist Item Schema Name"
},
"formlist_fields_to_include": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Formlist Fields To Include"
}
},
"title": "UiFieldExtensionDomainInputDTO",
"type": "object"
}
},
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"properties": {
"type": "array",
"items": {
"$ref": "#/$defs/DtoPropertyDefinitionDomainInputDTO"
},
"title": "Properties"
},
"ui_hints": {
"anyOf": [
{
"$ref": "#/$defs/DtoSchemaUiHintsDomainInputDTO"
},
{
"type": "null"
}
],
"default": null
},
"version_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Version Name"
}
},
"required": [
"name",
"properties"
],
"title": "DtoDefinitionInputDTO",
"type": "object"
}

Naming and Location Conventions

Class: PascalCase, typically ends with 'DTO'. File: ${dto_name}.py (based on ${dto_name}). Location: app/api/${version}/dtos. (Requires context: ['version'])

Example Definition

No example available.