Enhance Swagger Documentation for CMS API

- Updated Swagger documentation to include new fields: CompanyName, Country, and Language, improving clarity and usability for API consumers.
- Added a new Type field with enumerations for Company and Organization, enhancing data categorization in the CMS API.
- Reflected changes in the definitions for CMS entities, ensuring accurate representation of the API structure and expected inputs/outputs.
- Improved examples in the documentation to provide better guidance for developers integrating with the CMS API.
This commit is contained in:
Nima Nakhostin
2025-11-09 10:21:41 +03:30
parent a363078d6f
commit 265ea4a7c6
3 changed files with 82 additions and 0 deletions
+31
View File
@@ -7771,6 +7771,14 @@ const docTemplate = `{
"language": { "language": {
"type": "string", "type": "string",
"example": "en" "example": "en"
},
"type": {
"allOf": [
{
"$ref": "#/definitions/cms.CMSType"
}
],
"example": "company"
} }
} }
}, },
@@ -7797,9 +7805,15 @@ const docTemplate = `{
"chart": { "chart": {
"$ref": "#/definitions/cms.chartSection" "$ref": "#/definitions/cms.chartSection"
}, },
"company_name": {
"type": "string"
},
"contact": { "contact": {
"$ref": "#/definitions/cms.contactSection" "$ref": "#/definitions/cms.contactSection"
}, },
"country": {
"type": "string"
},
"created_at": { "created_at": {
"type": "integer" "type": "integer"
}, },
@@ -7818,11 +7832,28 @@ const docTemplate = `{
"key": { "key": {
"type": "string" "type": "string"
}, },
"language": {
"type": "string"
},
"type": {
"$ref": "#/definitions/cms.CMSType"
},
"updated_at": { "updated_at": {
"type": "integer" "type": "integer"
} }
} }
}, },
"cms.CMSType": {
"type": "string",
"enum": [
"company",
"organization"
],
"x-enum-varnames": [
"CMSTypeCompany",
"CMSTypeOrganization"
]
},
"cms.card": { "cms.card": {
"type": "object", "type": "object",
"properties": { "properties": {
+31
View File
@@ -7763,6 +7763,14 @@
"language": { "language": {
"type": "string", "type": "string",
"example": "en" "example": "en"
},
"type": {
"allOf": [
{
"$ref": "#/definitions/cms.CMSType"
}
],
"example": "company"
} }
} }
}, },
@@ -7789,9 +7797,15 @@
"chart": { "chart": {
"$ref": "#/definitions/cms.chartSection" "$ref": "#/definitions/cms.chartSection"
}, },
"company_name": {
"type": "string"
},
"contact": { "contact": {
"$ref": "#/definitions/cms.contactSection" "$ref": "#/definitions/cms.contactSection"
}, },
"country": {
"type": "string"
},
"created_at": { "created_at": {
"type": "integer" "type": "integer"
}, },
@@ -7810,11 +7824,28 @@
"key": { "key": {
"type": "string" "type": "string"
}, },
"language": {
"type": "string"
},
"type": {
"$ref": "#/definitions/cms.CMSType"
},
"updated_at": { "updated_at": {
"type": "integer" "type": "integer"
} }
} }
}, },
"cms.CMSType": {
"type": "string",
"enum": [
"company",
"organization"
],
"x-enum-varnames": [
"CMSTypeCompany",
"CMSTypeOrganization"
]
},
"cms.card": { "cms.card": {
"type": "object", "type": "object",
"properties": { "properties": {
+20
View File
@@ -50,6 +50,10 @@ definitions:
language: language:
example: en example: en
type: string type: string
type:
allOf:
- $ref: '#/definitions/cms.CMSType'
example: company
type: object type: object
cms.CMSListResponse: cms.CMSListResponse:
properties: properties:
@@ -66,8 +70,12 @@ definitions:
$ref: '#/definitions/cms.cardSection' $ref: '#/definitions/cms.cardSection'
chart: chart:
$ref: '#/definitions/cms.chartSection' $ref: '#/definitions/cms.chartSection'
company_name:
type: string
contact: contact:
$ref: '#/definitions/cms.contactSection' $ref: '#/definitions/cms.contactSection'
country:
type: string
created_at: created_at:
type: integer type: integer
features: features:
@@ -80,9 +88,21 @@ definitions:
type: string type: string
key: key:
type: string type: string
language:
type: string
type:
$ref: '#/definitions/cms.CMSType'
updated_at: updated_at:
type: integer type: integer
type: object type: object
cms.CMSType:
enum:
- company
- organization
type: string
x-enum-varnames:
- CMSTypeCompany
- CMSTypeOrganization
cms.card: cms.card:
properties: properties:
description: description: