-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(language-server): Add yaml schema for definitions file (#74)
- Loading branch information
1 parent
89f94f4
commit 65ec44a
Showing
9 changed files
with
784 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> | ||
<GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
<DebuggerSupport>false</DebuggerSupport> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="File.fs"/> | ||
<Compile Include="Definitions.fs"/> | ||
<Compile Include="CandidateTerms.fs"/> | ||
</ItemGroup> | ||
<Import Project="..\..\.paket\Paket.Restore.targets"/> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> | ||
<GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
<DebuggerSupport>false</DebuggerSupport> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="File.fs" /> | ||
<Compile Include="DefinitionsSchema.fs" /> | ||
<Compile Include="Definitions.fs" /> | ||
<Compile Include="CandidateTerms.fs" /> | ||
</ItemGroup> | ||
<Import Project="..\..\.paket\Paket.Restore.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
module Contextive.Core.DefinitionsSchema | ||
|
||
let schema = | ||
"""{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://contextive.tech/", | ||
"title": "Contextive Definitions Schema", | ||
"description": "Schema for defining an ubiquitous language.", | ||
"type": "object", | ||
"properties": { | ||
"contexts": { | ||
"description": "A list of contexts.", | ||
"type": "array", | ||
"items": { | ||
"title": "Context", | ||
"description": "A context in the ubiquitous language, consisting of a list of terms.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"description": "The name of the context.", | ||
"type": "string", | ||
"examples": [ | ||
"Cargo" | ||
] | ||
}, | ||
"domainVisionStatement": { | ||
"title": "Domain Vision Statement", | ||
"description": "A statement that describes the purpose of the context.", | ||
"type": "string", | ||
"examples": [ | ||
"To manage the routing of cargo through transportation legs" | ||
] | ||
}, | ||
"paths": { | ||
"title": "Paths", | ||
"description": "A list of paths that the context is involved in.", | ||
"type": "array", | ||
"items": { | ||
"title": "Path", | ||
"description": "A path that the context is involved in.", | ||
"type": "string", | ||
"examples": [ | ||
"CargoDemo", | ||
"'**' # default, all paths" | ||
] | ||
}, | ||
"examples": [ | ||
[ | ||
"CargoDemo" | ||
] | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
}, | ||
"terms": { | ||
"title": "Terms", | ||
"description": "A list of terms in the context.", | ||
"type": "array", | ||
"items": { | ||
"title": "Term", | ||
"description": "A term in the context.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"description": "The name of the term.", | ||
"type": "string", | ||
"examples": [ | ||
"Cargo" | ||
] | ||
}, | ||
"definition": { | ||
"title": "Definition", | ||
"description": "A definition of the term.", | ||
"type": "string", | ||
"examples": [ | ||
"A unit of transportation that needs moving and delivery to its delivery location." | ||
] | ||
}, | ||
"examples": { | ||
"title": "Examples", | ||
"description": "A list of example sentences using the term.", | ||
"type": "array", | ||
"items": { | ||
"title": "Example sentence", | ||
"description": "An example sentence using the term.", | ||
"type": "string", | ||
"examples": [ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
] | ||
}, | ||
"examples": [ | ||
[ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
] | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
}, | ||
"aliases": { | ||
"title": "Aliases", | ||
"description": "A list of aliases for the term.", | ||
"type": "array", | ||
"items": { | ||
"title": "Alias", | ||
"description": "An alias for the term.", | ||
"type": "string", | ||
"examples": [ | ||
"unit" | ||
] | ||
}, | ||
"examples": [ | ||
[ | ||
"unit" | ||
] | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
}, | ||
"required": ["name"] | ||
}, | ||
"examples": [ | ||
{ | ||
"name": "Cargo", | ||
"definition": "A unit of transportation that needs moving and delivery to its delivery location.", | ||
"examples": [ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
], | ||
"aliases": [ | ||
"unit" | ||
] | ||
} | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
}, | ||
"required": ["name", "terms"] | ||
}, | ||
"minItems": 1, | ||
"uniqueItems": true, | ||
"examples": [ | ||
{ | ||
"name": "Cargo", | ||
"domainVisionStatement": "To manage the routing of cargo through transportation legs", | ||
"paths": [ | ||
"CargoDemo" | ||
], | ||
"terms": [ | ||
{ | ||
"name": "Cargo", | ||
"definition": "A unit of transportation that needs moving and delivery to its delivery location.", | ||
"examples": [ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
], | ||
"aliases": [ | ||
"unit" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"required": ["contexts"] | ||
} | ||
""" |
169 changes: 169 additions & 0 deletions
169
...finitionsInitializationTests.Default Definitions Schema in Non-existent Path.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://contextive.tech/", | ||
"title": "Contextive Definitions Schema", | ||
"description": "Schema for defining an ubiquitous language.", | ||
"type": "object", | ||
"properties": { | ||
"contexts": { | ||
"description": "A list of contexts.", | ||
"type": "array", | ||
"items": { | ||
"title": "Context", | ||
"description": "A context in the ubiquitous language, consisting of a list of terms.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"description": "The name of the context.", | ||
"type": "string", | ||
"examples": [ | ||
"Cargo" | ||
] | ||
}, | ||
"domainVisionStatement": { | ||
"title": "Domain Vision Statement", | ||
"description": "A statement that describes the purpose of the context.", | ||
"type": "string", | ||
"examples": [ | ||
"To manage the routing of cargo through transportation legs" | ||
] | ||
}, | ||
"paths": { | ||
"title": "Paths", | ||
"description": "A list of paths that the context is involved in.", | ||
"type": "array", | ||
"items": { | ||
"title": "Path", | ||
"description": "A path that the context is involved in.", | ||
"type": "string", | ||
"examples": [ | ||
"CargoDemo", | ||
"'**' # default, all paths" | ||
] | ||
}, | ||
"examples": [ | ||
[ | ||
"CargoDemo" | ||
] | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
}, | ||
"terms": { | ||
"title": "Terms", | ||
"description": "A list of terms in the context.", | ||
"type": "array", | ||
"items": { | ||
"title": "Term", | ||
"description": "A term in the context.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"description": "The name of the term.", | ||
"type": "string", | ||
"examples": [ | ||
"Cargo" | ||
] | ||
}, | ||
"definition": { | ||
"title": "Definition", | ||
"description": "A definition of the term.", | ||
"type": "string", | ||
"examples": [ | ||
"A unit of transportation that needs moving and delivery to its delivery location." | ||
] | ||
}, | ||
"examples": { | ||
"title": "Examples", | ||
"description": "A list of example sentences using the term.", | ||
"type": "array", | ||
"items": { | ||
"title": "Example sentence", | ||
"description": "An example sentence using the term.", | ||
"type": "string", | ||
"examples": [ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
] | ||
}, | ||
"examples": [ | ||
[ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
] | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
}, | ||
"aliases": { | ||
"title": "Aliases", | ||
"description": "A list of aliases for the term.", | ||
"type": "array", | ||
"items": { | ||
"title": "Alias", | ||
"description": "An alias for the term.", | ||
"type": "string", | ||
"examples": [ | ||
"unit" | ||
] | ||
}, | ||
"examples": [ | ||
[ | ||
"unit" | ||
] | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
}, | ||
"required": ["name"] | ||
}, | ||
"examples": [ | ||
{ | ||
"name": "Cargo", | ||
"definition": "A unit of transportation that needs moving and delivery to its delivery location.", | ||
"examples": [ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
], | ||
"aliases": [ | ||
"unit" | ||
] | ||
} | ||
], | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
}, | ||
"required": ["name", "terms"] | ||
}, | ||
"minItems": 1, | ||
"uniqueItems": true, | ||
"examples": [ | ||
{ | ||
"name": "Cargo", | ||
"domainVisionStatement": "To manage the routing of cargo through transportation legs", | ||
"paths": [ | ||
"CargoDemo" | ||
], | ||
"terms": [ | ||
{ | ||
"name": "Cargo", | ||
"definition": "A unit of transportation that needs moving and delivery to its delivery location.", | ||
"examples": [ | ||
"Multiple Customers are involved with a Cargo, each playing a different role.", | ||
"The Cargo delivery goal is specified." | ||
], | ||
"aliases": [ | ||
"unit" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"required": ["contexts"] | ||
} |
Oops, something went wrong.