diff --git a/mappings/.schema/descriptors.schema.yaml b/mappings/.schema/descriptors.schema.yaml new file mode 100644 index 0000000..24409ec --- /dev/null +++ b/mappings/.schema/descriptors.schema.yaml @@ -0,0 +1,26 @@ +title: Descriptor Mappings +type: object +required: + - name + - description + - mappings +properties: + name: + type: string + description: + type: string + mappings: + type: object + additionalProperties: + oneOf: + - type: string + - type: number + - type: object + properties: + additionalProperties: + oneOf: + - type: string + - type: number + - type: object + propertyNames: + pattern: ^[a-z][a-z_]+$ diff --git a/mappings/.schema/generic.schema.yaml b/mappings/.schema/generic.schema.yaml new file mode 100644 index 0000000..bd0367c --- /dev/null +++ b/mappings/.schema/generic.schema.yaml @@ -0,0 +1,17 @@ +title: Generic Mappings +type: object +required: + - name + - description + - mappings +properties: + name: + type: string + description: + type: string + mappings: + type: object + additionalProperties: + type: string + propertyNames: + pattern: ^[a-z][a-z|A-Z|_]+$ diff --git a/mappings/.schema/settings.schema.yaml b/mappings/.schema/settings.schema.yaml new file mode 100644 index 0000000..7a07886 --- /dev/null +++ b/mappings/.schema/settings.schema.yaml @@ -0,0 +1,17 @@ +title: Settings Mappings +type: object +required: + - name + - description + - mappings +properties: + name: + type: string + description: + type: string + mappings: + type: object + additionalProperties: + type: [string, number, boolean, array] + propertyNames: + pattern: ^[a-z][a-z|A-Z|_]+$ diff --git a/mappings/descriptors/generics/generic.yml b/mappings/descriptors/generics/generic.yml index 3226ed8..a58c054 100644 --- a/mappings/descriptors/generics/generic.yml +++ b/mappings/descriptors/generics/generic.yml @@ -1,6 +1,7 @@ --- +# yaml-language-server: $schema=../../.schema/descriptors.schema.yaml name: Generic descriptor mappings description: Descriptor Mappings for all tenant types (generic) mappings: example: one - exampleTwo: two + example_two: two diff --git a/mappings/descriptors/tenants/257378186566963200.yml b/mappings/descriptors/tenants/257378186566963200.yml index 6a56fc7..e85e37c 100644 --- a/mappings/descriptors/tenants/257378186566963200.yml +++ b/mappings/descriptors/tenants/257378186566963200.yml @@ -1,7 +1,9 @@ --- +# yaml-language-server: $schema=../../.schema/descriptors.schema.yaml + # A test mapping file for tenant 257378186566963200 referred as foo.example.com name: FOO.EXAMPLE.CO ORG mappings description: Descriptor mappings for tenant FOO.EXAMPLE.CO mappings: example: one - exampleTwo: two + example_two: two diff --git a/mappings/settings/generics/generic.yaml b/mappings/settings/generics/generic.yaml index ffcdcc0..97a52dc 100644 --- a/mappings/settings/generics/generic.yaml +++ b/mappings/settings/generics/generic.yaml @@ -1,4 +1,5 @@ --- +# yaml-language-server: $schema=../../.schema/settings.schema.yaml name: Settings for all tenant types (Generic) description: These are generic settings for all the tenant types mappings: diff --git a/mappings/settings/tenants/257378186566963200.yml b/mappings/settings/tenants/257378186566963200.yml new file mode 100644 index 0000000..121695d --- /dev/null +++ b/mappings/settings/tenants/257378186566963200.yml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=../../.schema/settings.schema.yaml + +# A test settings mapping file for tenant 257378186566963200 referred as foo.example.com +name: Settings for all tenant types (Generic) +description: These are generic settings for all the tenant types +mappings: + tracking: + # This will be overridden from `null` to the below value + - domain: https://link.foo.com diff --git a/src/Concerns/FunctionalMappingTypes.php b/src/Concerns/FunctionalMappingTypes.php index ed55a78..bae4b31 100644 --- a/src/Concerns/FunctionalMappingTypes.php +++ b/src/Concerns/FunctionalMappingTypes.php @@ -89,7 +89,7 @@ public function genericMapFile(): string /** * Get tenant map file `/path/name` * - * @param string $tenantId Tenant UID + * @param string $tenantId Tenant ID */ public function tenantMapFile(string $tenantId): string { diff --git a/src/Contracts/MappingType.php b/src/Contracts/MappingType.php index 4a2d008..3794901 100644 --- a/src/Contracts/MappingType.php +++ b/src/Contracts/MappingType.php @@ -58,7 +58,7 @@ public function genericMapFile(): string; /** * Get tenant map file `/path/name` * - * @param string $tenantId Tenant UID + * @param string $tenantId Tenant ID */ public function tenantMapFile(string $tenantId): string;