Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions calm-ai/tools/architecture-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Every CALM architecture MUST include:

```json
{
"$schema": "https://calm.finos.org/release/1.0/meta/calm.json",
"$schema": "https://calm.finos.org/release/1.1/meta/calm.json",
"unique-id": "string",
"name": "string",
"description": "string"
Expand Down Expand Up @@ -59,7 +59,7 @@ Every CALM architecture MUST include:

```json
{
"$schema": "https://calm.finos.org/release/1.0/meta/calm.json",
"$schema": "https://calm.finos.org/release/1.1/meta/calm.json",
"unique-id": "example-trading-system",
"name": "Example Trading System",
"description": "A simple trading system architecture",
Expand Down
58 changes: 29 additions & 29 deletions calm-ai/tools/pattern-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A CALM pattern is a JSON schema that:

```json
{
"$schema": "https://calm.finos.org/release/1.0/meta/calm.json",
"$schema": "https://calm.finos.org/release/1.1/meta/calm.json",
"$id": "https://your-domain.com/patterns/my-pattern.json",
"title": "My Architecture Pattern",
"type": "object",
Expand All @@ -31,7 +31,7 @@ A CALM pattern is a JSON schema that:
"maxItems": 3,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": {
Expand Down Expand Up @@ -73,7 +73,7 @@ Patterns use JSON schema constructs to provide choices and options:
{
"anyOf": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "postgres-db" },
Expand All @@ -82,7 +82,7 @@ Patterns use JSON schema constructs to provide choices and options:
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "mysql-db" },
Expand All @@ -106,7 +106,7 @@ Patterns use JSON schema constructs to provide choices and options:
"type": "array",
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/relationship",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/relationship",
"type": "object",
"properties": {
"unique-id": { "const": "database-choice" },
Expand All @@ -122,7 +122,7 @@ Patterns use JSON schema constructs to provide choices and options:
{
"oneOf": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/decision",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/decision",
"type": "object",
"properties": {
"description": {
Expand All @@ -139,7 +139,7 @@ Patterns use JSON schema constructs to provide choices and options:
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/decision",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/decision",
"type": "object",
"properties": {
"description": {
Expand Down Expand Up @@ -174,7 +174,7 @@ Patterns use JSON schema constructs to provide choices and options:

```json
{
"$schema": "https://calm.finos.org/release/1.0/meta/calm.json",
"$schema": "https://calm.finos.org/release/1.1/meta/calm.json",
"$id": "https://patterns.company.com/conference-signup.pattern.json",
"title": "Conference Signup Pattern",
"description": "A reusable architecture pattern for conference signup systems with Kubernetes deployment",
Expand All @@ -186,7 +186,7 @@ Patterns use JSON schema constructs to provide choices and options:
"maxItems": 4,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "frontend" },
Expand All @@ -201,7 +201,7 @@ Patterns use JSON schema constructs to provide choices and options:
"maxItems": 1,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/interface.json#/defs/url-interface",
"$ref": "https://calm.finos.org/release/1.1/meta/interface.json#/defs/url-interface",
"properties": {
"unique-id": { "const": "frontend-url" }
}
Expand All @@ -211,7 +211,7 @@ Patterns use JSON schema constructs to provide choices and options:
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "api-service" },
Expand All @@ -226,13 +226,13 @@ Patterns use JSON schema constructs to provide choices and options:
"maxItems": 2,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/interface.json#/defs/container-image-interface",
"$ref": "https://calm.finos.org/release/1.1/meta/interface.json#/defs/container-image-interface",
"properties": {
"unique-id": { "const": "api-image" }
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/interface.json#/defs/port-interface",
"$ref": "https://calm.finos.org/release/1.1/meta/interface.json#/defs/port-interface",
"properties": {
"unique-id": { "const": "api-port" }
}
Expand All @@ -244,7 +244,7 @@ Patterns use JSON schema constructs to provide choices and options:
{
"anyOf": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "postgres-db" },
Expand All @@ -256,15 +256,15 @@ Patterns use JSON schema constructs to provide choices and options:
"maxItems": 2,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/interface.json#/defs/container-image-interface",
"$ref": "https://calm.finos.org/release/1.1/meta/interface.json#/defs/container-image-interface",
"properties": {
"unique-id": {
"const": "postgres-image"
}
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/interface.json#/defs/port-interface",
"$ref": "https://calm.finos.org/release/1.1/meta/interface.json#/defs/port-interface",
"properties": {
"unique-id": {
"const": "postgres-port"
Expand All @@ -276,7 +276,7 @@ Patterns use JSON schema constructs to provide choices and options:
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "mysql-db" },
Expand All @@ -288,15 +288,15 @@ Patterns use JSON schema constructs to provide choices and options:
"maxItems": 2,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/interface.json#/defs/container-image-interface",
"$ref": "https://calm.finos.org/release/1.1/meta/interface.json#/defs/container-image-interface",
"properties": {
"unique-id": {
"const": "mysql-image"
}
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/interface.json#/defs/port-interface",
"$ref": "https://calm.finos.org/release/1.1/meta/interface.json#/defs/port-interface",
"properties": {
"unique-id": {
"const": "mysql-port"
Expand All @@ -310,7 +310,7 @@ Patterns use JSON schema constructs to provide choices and options:
]
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "k8s-cluster" },
Expand All @@ -329,7 +329,7 @@ Patterns use JSON schema constructs to provide choices and options:
"maxItems": 3,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/relationship",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/relationship",
"type": "object",
"properties": {
"unique-id": { "const": "frontend-to-api" },
Expand All @@ -349,7 +349,7 @@ Patterns use JSON schema constructs to provide choices and options:
"required": ["description"]
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/relationship",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/relationship",
"type": "object",
"properties": {
"unique-id": { "const": "api-to-database" },
Expand All @@ -369,7 +369,7 @@ Patterns use JSON schema constructs to provide choices and options:
"required": ["description"]
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/relationship",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/relationship",
"properties": {
"unique-id": { "const": "deployed-in-k8s" },
"description": {
Expand Down Expand Up @@ -440,7 +440,7 @@ Patterns can include security controls on relationships:

```json
"controls": {
"$ref": "https://calm.finos.org/release/1.0/meta/control.json#/defs/controls",
"$ref": "https://calm.finos.org/release/1.1/meta/control.json#/defs/controls",
"properties": {
"security": {
"type": "object",
Expand All @@ -454,7 +454,7 @@ Patterns can include security controls on relationships:
"maxItems": 1,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/control.json#/defs/control-detail",
"$ref": "https://calm.finos.org/release/1.1/meta/control.json#/defs/control-detail",
"properties": {
"requirement-url": {
"const": "https://schemas.company.com/security/connection-security.json"
Expand Down Expand Up @@ -530,14 +530,14 @@ The CLI will prompt for choices when encountering `anyOf`/`oneOf` options, or yo
### Schema References

- `$ref` - Reference base CALM schema definitions
- Always reference `https://calm.finos.org/release/1.0/meta/core.json#/defs/node` for nodes
- Always reference `https://calm.finos.org/release/1.0/meta/core.json#/defs/relationship` for relationships
- Reference specific interface schemas from `https://calm.finos.org/release/1.0/meta/interface.json#/defs/`
- Always reference `https://calm.finos.org/release/1.1/meta/core.json#/defs/node` for nodes
- Always reference `https://calm.finos.org/release/1.1/meta/core.json#/defs/relationship` for relationships
- Reference specific interface schemas from `https://calm.finos.org/release/1.1/meta/interface.json#/defs/`

## Validation Rules

1. Pattern must be a valid JSON schema extending CALM architecture schema
2. Must reference base CALM schema: `"$schema": "https://calm.finos.org/release/1.0/meta/calm.json"`
2. Must reference base CALM schema: `"$schema": "https://calm.finos.org/release/1.1/meta/calm.json"`
3. Node definitions must use `$ref` to core node schema
4. Relationship definitions must use `$ref` to core relationship schema
5. Use `const` for fixed values, `anyOf`/`oneOf` for options
Expand Down
2 changes: 1 addition & 1 deletion docs/quick-start/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ Add a new array called `flows` with a single flow in, we've provided you with it
],
"flows": [
{
"$schema": "https://calm.finos.org/release/1.0-rc1/meta/flow.json",
"$schema": "https://calm.finos.org/release/1.1/meta/flow.json",
"$id": "https://calm.finos.org/getting-started/flows/conference-signup.flow.json",
"unique-id": "flow-conference-signup",
"name": "Conference Signup Flow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('JsonSchemaValidator', () => {
});

describe('JsonSchemaValidator integration', () => {
const schemaDir = path.join(__dirname, '../../../../calm/release/1.0/meta/');
const schemaDir = path.join(__dirname, '../../../../calm/release/1.1/meta/');
const badPatternPath = path.join(__dirname, '../../../test_fixtures/bad-schema/bad-json-schema.json');

it('throws when compiling the bad-json-schema fixture', async () => {
Expand Down
4 changes: 2 additions & 2 deletions shared/src/commands/validate/validate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('validation support functions', () => {
const given: ErrorObject[] = [
{
'instancePath': '/nodes/0/interfaces/0/port',
'schemaPath': 'https://calm.finos.org/release/1.0/meta/interface.json#/defs/host-port-interface/properties/port/type',
'schemaPath': 'https://calm.finos.org/release/1.1/meta/interface.json#/defs/host-port-interface/properties/port/type',
'keyword': 'type',
'params': {
'type': 'integer'
Expand All @@ -209,7 +209,7 @@ describe('validation support functions', () => {
'error',
'must be integer',
'/nodes/0/interfaces/0/port',
'https://calm.finos.org/release/1.0/meta/interface.json#/defs/host-port-interface/properties/port/type'
'https://calm.finos.org/release/1.1/meta/interface.json#/defs/host-port-interface/properties/port/type'
)
];

Expand Down
4 changes: 2 additions & 2 deletions shared/src/schema-directory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ describe('SchemaDirectory', () => {
it('resolves a reference from a stored schema', async () => {
const schemaDir = new SchemaDirectory(mockDocLoader);

const nodeJson = loadSchema(path.join(__dirname, '../../calm/release/1.0/meta/core.json'));
const nodeRef = 'https://calm.finos.org/release/1.0/meta/core.json#/defs/node';
const nodeJson = loadSchema(path.join(__dirname, '../../calm/release/1.1/meta/core.json'));
const nodeRef = 'https://calm.finos.org/release/1.1/meta/core.json#/defs/node';

mockDocLoader.loadMissingDocument.mockReturnValueOnce(new Promise(resolve => resolve(nodeJson)));

Expand Down
10 changes: 5 additions & 5 deletions shared/test_fixtures/api-gateway-with-no-relationships.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://calm.finos.org/release/1.0/meta/calm.json",
"$schema": "https://calm.finos.org/release/1.1/meta/calm.json",
"$id": "https://calm.finos.org/pattern/api-gateway",
"title": "API Gateway Pattern",
"type": "object",
Expand All @@ -9,7 +9,7 @@
"minItems": 3,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"properties": {
"ingress-host": {
"type": "string"
Expand Down Expand Up @@ -40,7 +40,7 @@
]
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"properties": {
"description": {
"const": "The API Consumer making an authenticated and authorized request"
Expand All @@ -57,7 +57,7 @@
}
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"properties": {
"host": {
"type": "string"
Expand All @@ -84,7 +84,7 @@
]
},
{
"$ref": "https://calm.finos.org/release/1.0/meta/core.json#/defs/node",
"$ref": "https://calm.finos.org/release/1.1/meta/core.json#/defs/node",
"properties": {
"description": {
"const": "The Identity Provider used to verify the bearer token"
Expand Down
Loading
Loading