Skip to content

Add support for flows inside pattern using const to a url reference + confirm generated arch document renders flow in docify #1374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LeighFinegold
Copy link
Member

@LeighFinegold LeighFinegold commented Jun 20, 2025

Changes to calm generate Function

The instantiateFromProperties function in the instantiate.ts file has been modified with three key changes:

1. Added Support for Constant Values in Array Items

This allows support in the pattern like this

    "flows": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "prefixItems": [
        {
          "const": "https://calm.finos.org/workshop/flows/conference-signup.flow.json"
        }
      ]
    }

2. Updated example on workshop to show generate works as expected and that subsequent docify command will render flow diagram like below

image

… confirm generated arch document renders flow in docify
output[key] = await Promise.all(
resolvedDef.prefixItems.map(async (itemDef, idx) => {
const resolvedItem = await resolveSchema(itemDef, schemaDir);
if (resolvedItem.const !== undefined) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing

if (resolvedItem.const !== undefined) {
    return resolvedItem.const;
}

over

if (resolvedItem.const) {
    return resolvedItem.const;
}

Allows support for

{ const: null }

@@ -26,15 +26,22 @@ describe('Docifier E2E - Real Model and Template', () => {

it('generates documentation from the conference-signup.arch.json model', async () => {

const docifier = new Docifier('WEBSITE', join(INPUT_DIR, 'conference-signup.arch.json'), NON_SECURE_VERSION_DOC_WEBSITE, new Map<string,string>());
//TODO: This test needs manual mapping until flows folder is republished.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If folks are happy with this PR, then recommend we first just publish the new flows document to S3 and then this will not be needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant