Skip to content

v3.7.0

Compare
Choose a tag to compare
@mttrbrts mttrbrts released this 09 Mar 11:42
· 188 commits to main since this release
a52af54

What's Changed

  1. #549 Improved support for Concerto model inference from OpenAPI v3 and JSON Schema files. Exposed on the concerto infer CLI command.
const {OpenAPIVisitor} = require("@accordproject/concerto-tools").CodeGen;
//...
const concertoModelJson = OpenApiVisitor
    .parse(myOpenApiSpecification)
    .accept(
        new OpenApiVisitor(), {
            metaModelNamespace: 'concerto.metamodel@1.0.0',
            namespace: 'com.test@1.0.0',
        }
    );
    
 console.log(Printer.toCTO(
    concertoModelJson.models[0]
));

The generated model also includes types for request and response payloads and untyped "JSON" objects.

  1. Adds utilities to allow navigation of the dependency tree of a model as a graph. This allows for more advanced operations like "tree-shaking" of large models and finding unused imports.
const {ConcertoGraphVisitor, DirectedGraph} = require("@accordproject/concerto-tools").Common;
// ...
const visitor = new ConcertoGraphVisitor();
const graph = new DirectedGraph();
modelManager.accept(visitor, { graph });

// Find the maximal subgraph starting from 'ChangeOfAddress'
const connectedGraph = graph.findConnectedGraph('org.acme.hr@1.0.0.ChangeOfAddress');

const filteredModelManager = modelManager
  .filter(declaration => 
    connectedGraph.hasVertex(declaration.getFullyQualifiedName())
  );

Commits

  • feat(tools): add graph and graph search by @mttrbrts in #614
  • feat(tools): parse OpenAPI to Concerto Metamodel JSON by @stefanblaginov in #594
  • fix(tools): improve how plantuml namespaces are rendered by @dselman in #615
  • fix(tools): Fix for PlantUML relationships and aggregations by @dselman in #616
  • fix(metamodel): handle missing optional values in metamodel instance by @mttrbrts in #619
  • fix(tools): issue when converting a valid model to Protobuf by @stefanblaginov in #618
  • chore(actions): publish v3.6.0 to npm by @github-actions in #612

Full Changelog: v3.6.0...v3.7.0