accordproject / concerto Goto Github PK
View Code? Open in Web Editor NEWBusiness schema language and runtime
Home Page: https://concerto.accordproject.org
License: Apache License 2.0
Business schema language and runtime
Home Page: https://concerto.accordproject.org
License: Apache License 2.0
The Codegen functionality drags in quite a few dependencies. We should move that into a separate module composer-concerto-tools
?
Add the cto
command line utility to it as well.
It would be great to move FileWriter into its own or another module (concerto-tools?). It depends on mkdirp
which drags in minimist
.
The loopback visitor assumes that transactions have a timestamp field, while the grammar doesn't impose this (the system model does).
We should automatically add a timestamp
field to all transactions.
DEVELOPERS
and CONTRIBUTING
is tailored to this repo specificallyThis issue can provide for multiple pull requests.
Describe the bug
In DEVELOPERS.md (here), need to replace Cicero
with Concerto
.
In section building concerto (here), URL of the main repository to be added as upstream has a typo in it. acccordproject
should be accordproject
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Instead of acccordproject
, it should be accordproject
, and Cicero
should be replaced with Concerto
Is it recommended best practice to use Java.time rather than the older (and considered poorly designed) Java.util.date, as currently used by the concerto-tools
Java target.
This isn't a bug, but a suggestion for improvement.
CTO concepts making use of the DateTime
atomic types should generate Java classes with fields using java.time.Instant
.
CTO concepts making use of the DateTime
atomic types generate Java classes with fields using java.util.Date
.
Maybe, just this line to change:
Is your feature request related to a problem? Please describe.
The ability to resolve and download external model to a local directory.
Describe the solution you'd like
A command line tool which lets people resolve external model references (with from
) and generate files in a given directory.
Additional context
In addition to being a useful tool for users, some of the Accord Project stack depends on external models at build time (markdown-transform
requires CommonMark and CiceroMark ASTs, and ergo-compiler
requires base models for the contract and runtime).
This seems to be dead code https://github.com/accordproject/concerto/blob/master/packages/concerto-core/lib/module/loadModule.js
I cannot find any use of it anywhere. Suggestion is to remove it and remove the corresponding npm-paths
dependency.
Is your feature request related to a problem? Please describe.
Ergo 0.20.* relies on a few changes to the Concerto serialisation that have to be consistent with the Ergo JavaScript run time. The changes include:
Integer
and Long
values to ensure proper printing in toString
and in the templates supportThis should be controlled by a proper option on the serialiser and ensure backward compatibility when that option is turned off (which should be the default).
Describe the solution you'd like
Fold changes for that serialization from the Ergo 0.20 branch into Concerto, which avoid much code duplication and provides for better and more systematic testing.
Additional context
This is part of a core refactoring for the 0.20
release. This change will also facilitate review and discussion for improvements in future releases.
We allow the ModelManager
to specify implicit super types for class declarations (currently via a map). The map based approach has a couple of issues:
This is also related to the ClassDeclaration.isSystemCoreType
method.
We should report test coverage for the whole monorepo, including a badge in the README.
Tasks:
Cicero-cli
If I run lint on concerto-core
:
bash-3.2$ npm run lint
> @accordproject/[email protected] lint /Users/jeromesimeon/git/concerto/packages/concerto-core
> eslint .
/Users/jeromesimeon/git/concerto/packages/concerto-core/lib/baseexception.js
15:1 error 'use strict' is unnecessary inside of modules strict
/Users/jeromesimeon/git/concerto/packages/concerto-core/lib/basefileexception.js
15:1 error 'use strict' is unnecessary inside of modules strict
/Users/jeromesimeon/git/concerto/packages/concerto-core/lib/codegen/filewriter.js
15:1 error 'use strict' is unnecessary inside of modules strict
/Users/jeromesimeon/git/concerto/packages/concerto-core/lib/codegen/fromjs/apisignaturegenerator.js
15:1 error 'use strict' is unnecessary inside of modules strict
/Users/jeromesimeon/git/concerto/packages/concerto-core/lib/codegen/fromjs/jsongenerator.js
15:1 error 'use strict' is unnecessary inside of modules strict
/Users/jeromesimeon/git/concerto/packages/concerto-core/lib/codegen/fromjs/plantumlgenerator.js
15:1 error 'use strict' is unnecessary inside of modules strict
42:13 warning Unexpected console statement no-console
46:13 warning Unexpected console statement no-console
105:9 warning Unexpected console statement no-console
106:9 warning Unexpected console statement no-console
107:9 warning Unexpected console statement no-console
110:9 warning Unexpected console statement no-console
...
The concerto CLI help shows:
bash-3.2$ concerto --version
0.80.4-20191002122338
bash-3.2$ concerto --help
cli <cmd> [args]
Commands:
cli generate generate code from model files
cli get save local copies of external model dependencies
Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
bash-3.2$
It should say instead:
bash-3.2$ concerto --help
concerto <cmd> [args]
Commands:
concerto generate generate code from model files
concerto get save local copies of external model dependencies
Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
bash-3.2$
Code of Conduct URL is broken in CONTRIBUTING.md
It is redirecting to https://github.com/accordproject/docs/blob/master/Accord%20Project%20Code%20of%20Conduct.pdf
I am sending a PR with this URL https://lfprojects.org/policies/code-of-conduct/
v0.20
project
The existing add-on supports a lot more than just CTO files, and doesn't handle import
... from
consistently.
https://marketplace.visualstudio.com/items?itemName=HyperledgerComposer.composer-support-client
Is your feature request related to a problem? Please describe.
The error message that appears when I enter incorrect commands are confusing and quite generic.
hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto validate
15:13:21 - error: ENOENT: no such file or directory, open 'sample.json'
hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto compile
15:13:29 - error: EISDIR: illegal operation on a directory, read
hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto get
15:13:32 - error: EISDIR: illegal operation on a directory, read
hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty/models$ concerto compile clause.cto --target Go
15:13:41 - error: EISDIR: illegal operation on a directory, read
Describe the solution you'd like
More informative error messages.
For example, this error message (when I used a wrong .json file) was quite helpful:
hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto validate --sample package.json --ctoFiles models/clause.cto
15:10:08 - error: Invalid JSON data. Does not contain a $class type identifier.
For the code snippet above, for example concerto compile clause.cto --target Go
, an error message could be something like:
error: target CTO file unclear.
Try including --ctoFiles in front of the target CTO files you want to convert
or a more generic, but more specific, error message (compared to EISDIR
) would be:
error: cannot find command arguments.
Try using `concerto compile --ctoFiles <filename> --target <targetFormat>`
Describe alternatives you've considered
N/A
Additional context
concerto version 0.82.4
There is a link to Code of Conduct link in contributing.md file that need to be fixed . It is a issue to be solved as soon as possible so that people are aware about accord code of conduct.
To support textual variants of the same enumeration element in a model, the model definition should allow annotations that enumerate text alternatives.
The annotation could also be used to capture language-specific variants of a model element.
This would clean up model enumerations so that they only need to define a single element per semantic element. Logic that operates on enumerations (for example match
statements in Ergo) would then also not need to match multiple values
Where an annotation is not provided, the String value of the element would be used.
For example:
enum TemporalUnit {
@alternativeText('day','days','jour','jours')
o DAY
//...
}
We could even consider something like a .language
file to externalize language definitions, e.g.
enum TemporalUnit {
@languageKey('DAY')
o DAY
//...
}
and in model.en.language
{
"DAY": ["day", "days"]
}
alternative
, alternativeText
, verbalization
, localization
, textOptions
etc..)This is a feature request. Original issue was posted by @mttrbrts here: accordproject/template-archive#111
If you use the ModelManager without a system model specified you get a failure.
IllegalModelException: Could not find super type undefined File './models/domain.cto': line 9 column 1, to line 17 column 2.
Update the Concerto module name to @accordproject/concerto
and use the standard AP release process and build scripts.
When I use composer-concerto into another package and then I use this new package into an application it throws this error:
Error: Cannot find module 'doctrine'
doctrine and acorn are required by the application but have been moved in devDependencies
no errors
this error:
Error: Cannot find module 'doctrine'
move doctrine and acorn to dependencies
import composer-concerto in another package
Is your feature request related to a problem? Please describe.
Most errors include location information, but validation and type not found errors do not.
Describe the solution you'd like
When validating a JSON instance against a model fails, provide location information for where the error occurred in the JSON instance.
When loading a model which has an unknown type, provide location information for where that type is used in the model.
Describe alternatives you've considered
I haven't.
Additional context
Here is an example of an exception with location information (it inherits from BaseFileException
):
https://github.com/accordproject/concerto/blob/master/packages/concerto-core/lib/introspect/parseexception.js
Currently when running the CLI in those cases:
bash-3.2$ concerto generate --ctoFiles test/models/typenotfound.cto
Undeclared type BUBBLE in property org.accordproject.money.CryptoMonetaryAmount.doubleValue File 'test/models/typenotfound.cto': IllegalModelException: Undeclared type BUBBLE in property org.accordproject.money.CryptoMonetaryAmount.doubleValue File 'test/models/typenotfound.cto':
bash-3.2$
bash-3.2$ concerto validate --ctoFiles test/models/money.cto --sample test/data/sample2.json
Instance undefined invalid enum value true for field CurrencyCode ValidationException: Instance undefined invalid enum value true for field CurrencyCode
Compared to the case where a file location is available:
bash-3.2$ concerto generate --ctoFiles test/models/parseerror.cto
Expected "-->", "@", "default", "o", "optional", "}", comment, end of line, or whitespace but "e" found. File test/models/parseerror.cto line 14 column 1 ParseException: Expected "-->", "@", "default", "o", "optional", "}", comment, end of line, or whitespace but "e" found. File test/models/parseerror.cto line 14 column 1
Using Concerto for data models with DateTime values in specific timezones
Deserialization/serialization should preserve the original timezone.
Deserialization/serialization shifts all dates to Z
timezone.
Unclear what changes are needed.
Some sample code, and a trace:
Model:
transaction PayOut {
o Double totalAmount
o DateTime dueBy
}
JavaScript code:
const response = {
"$class": "org.accordproject.ippayment.PayOut",
"totalAmount": 77.4,
"dueBy": Moment.parseZone("2018-04-12T04:00:00-05:00")
};
const validatedResponse = template.getSerializer().fromJSON(response);
const serializedResponse = template.getSerializer().toJSON(validatedResponse);
console.log('JSON: '+JSON.stringify(response));
console.log('VALIDATED: '+JSON.stringify(validatedResponse));
console.log('SERIALIZED: '+JSON.stringify(serializedResponse));
Trace:
JSON: {"$class":"org.accordproject.ippayment.PayOut","totalAmount":77.4,"dueBy":"2018-04-12T04:00:00-05:00"}
VALIDATED: {"$class":"org.accordproject.ippayment.PayOut","totalAmount":77.4,"dueBy":"2018-04-12T09:00:00.000Z","transactionId":"afc5fb0c-a776-44f7-9327-a47339aecdda","timestamp":"2019-03-06T13:12:37.640Z"}
SERIALIZED: {"$class":"org.accordproject.ippayment.PayOut","totalAmount":77.4,"dueBy":"2018-04-12T09:00:00.000Z","transactionId":"afc5fb0c-a776-44f7-9327-a47339aecdda","timestamp":"2019-03-06T13:12:37.640Z"}
I'm trying to use Concerto inside the accord project Cicero. Maintaining timezone information in date is important for applications.
Is your feature request related to a problem? Please describe.
Errors reported by the Concerto CLI are not terribly well formatted, and sometimes include duplicate text.
Describe the solution you'd like
Nicer looking errors, maybe using the logger we use in other parts of the Accord Project code base. Properly print the useful part of the error, without repetition.
Additional context
Some examples:
bash-3.2$ concerto validate --ctoFiles test/models/money.cto --sample test/data/sample2.json
Instance undefined invalid enum value true for field CurrencyCode ValidationException: Instance undefined invalid enum value true for field CurrencyCode
bash-3.2$ concerto validate --ctoFiles test/models/moneyErr.cto --sample test/data/sample2.json
Expected "-->", "@", "default", "o", "optional", "}", comment, end of line, or whitespace but "e" found. File test/models/moneyErr.cto line 14 column 1 ParseException: Expected "-->", "@", "default", "o", "optional", "}", comment, end of line, or whitespace but "e" found. File test/models/moneyErr.cto line 14 column 1
bash-3.2$ concerto generate --ctoFiles test/models/moneyErr.cto
Expected "-->", "@", "default", "o", "optional", "}", comment, end of line, or whitespace but "e" found. File test/models/moneyErr.cto line 14 column 1 ParseException: Expected "-->", "@", "default", "o", "optional", "}", comment, end of line, or whitespace but "e" found. File test/models/moneyErr.cto line 14 column 1
We should move the documentation for the CTO file format, runtime etc into the AP technical docs for publication and management:
https://github.com/accordproject/techdocs
Generate the JSDoc API docs and integrate into the technical docs.
Is your feature request related to a problem? Please describe.
There is currently no mechanism to modify a ModelFile in memory and then persist those changes back out to disk.
Describe the solution you'd like
Add a visitor to concerto-tools that visits a ModelManager and generates CTO files that can be round tripped.
Additional context
This feature would allow someone to build a graphical CTO file editor, with persistence back out to CTO files.
Is your feature request related to a problem? Please describe.
It would be useful to offer a command line interface (CLI) for concerto. This could be used to test whether a JSON document validate against a model, for generating other schema languages (XML Schema
, JSONSchema
, etc) from a model, or to resolve external models (See #66).
Describe the solution you'd like
The CLI could be called concerto
followed by a command and options:
concerto validate
for validationconcerto generate
for generating other scheme languagesconcerto get
for resolving modelsThese methods should be refactored (removed?) now that Concerto has been moved out of composer-common.
We need to tighten up the spec with respect to how we use relationships.
Describe the bug
It is possible to send an invalid request (with respect to the CTO model) and have the Ergo execute.
To Reproduce
cicero execute --request monthlysales-invalid.json --state state.json
Expected behavior
The execution should fail because sales[0].price.doubleValue
is a string.
Version
Cicero 0.13.5
It would be convenient to provide a way to easily get the string name for enumerated values. For instance to get the name of a currencyCode as a Java String.
It's not a bug, but feature request.
Calling myEnum.toString()
should return the name of the enum as a Java String.
The application has to create string representations (e.g., through myEnum.name()
) by hand.
Add a toString()
method for enums, maybe using .name()
for enums.
N/A
None found.
Working on an application where CTO models are generated to Java with additional fixes for the Corda network. Monetary amounts CTO representations which include an enum for currency codes are converted to Java Currency classes.
As far as I can tell, ./lib/codegen/parsejs.js
is only used as a developers dependency for generating the API documentation. It should be moved to a build-time directory such as scripts
.
There are a number of dependencies e.g., acorn
and doctrine
which are not needed at runtime, but are placed in the ./lib
directory. This means any consumer of the composer-concerto
package must also have those.
They also get bundled in through WebPack unnecessarily.
Same behaviour as not but without the dependencies to acorn
and doctrine
, etc.
Some current build-time dependencies are made necessary at runtime.
./lib/codegen/parsejs.js
and ./lib/codegen/javascriptparser.js
to ./scripts
acorn
and doctrine
from dependencies
to devDependencies
.This led to issue #43
Forced to add unnecessarily acorn
and doctrine
upstream in a consumer of Composer Concerto (Accord Project's Cicero and related packages).
We should remove this code so that people can use Concerto without using a system model.
The method AssetDeclaration.getSystemType
(and in all other types) is under specified and implies that there is a single system namespace.
/**
* Returns the base system type for Assets from the system namespace
*
* @return {string} the short name of the base system type
*/
getSystemType() {
return this.modelFile.getModelManager().getSystemModelTable().get('Asset');
}
Is your feature request related to a problem? Please describe.
The code is currently split across two projects: concerto
and concerto-tools
. It might be useful for maintenance (versioning, testing) if those are consolidated under a single project.
Describe the solution you'd like
A mono repo using lerna
which would include:
concerto-core
the core model manager/validatorconcerto-tools
auxiliary code for other schema languages generationconcerto-cli
for a command line (See #67)Possibly, a concerto-test
project could also be considered.
Additional context
This would also align with the structure for other Accord Project repositories (e.g., Cicero and Ergo).
Again, this implies that there is a single system namespace.
/**
* Returns true is this type is in the system namespace
*
* @return {boolean} true if the class may be pointed to by a relationship
*/
isSystemType() {
return this.modelFile.isSystemModelFile();
}
Support for system models has complicated the codebase and makes it hard to reuse models, as they now have an implicit dependency on a system model.
On balance I think we should make a breaking change and remove the support for system models, forcing people to explicitly declare dependencies on their own models using an import
with a from
.
The use of instanceof
to check whether an object is of a class leads to unreliable check when importing Composer Concerto in projects with deep npm dependencies.
Composer Concerto uses instanceof
checks e.g., here https://github.com/hyperledger/composer-concerto/blob/37189e52c4f52d13cbd862b38d36a64022976398/lib/serializer/resourcevalidator.js#L72 or here https://github.com/hyperledger/composer-concerto/blob/37189e52c4f52d13cbd862b38d36a64022976398/lib/serializer/jsonpopulator.js#L96
Those can be unreliable since it checks whether this is the same object from the exact same package installed in a node.js project.
The reason it is unreliable is that it is difficult to enforce that the corresponding version of composer-concerto
is installed exactly once in the ./node_modules
directory through npm install
.
This can lead to runtime errors when doing validation/serialization in some projects with deep npm dependencies.
A project should be able to import Composer Concerto 0.7.1 and PROJECT 0.X.X depending on e.g., Composer Concerto 0.7.0 without leading to runtime errors.
Currently a project has to ensure every dependency which import Composer Concerto have the exact same version, and that npm install
leads to only one copy of that same version, which is difficult to guarantee (due to the way npm install
works).
Several fixes are suggested in: https://stackoverflow.com/questions/41587865/using-instanceof-on-objects-created-with-constructors-from-deep-npm-dependenci
The recommended fix is to use an explicit method to check whether an object has the expected class. So instead of writing thing instanceof RelationshipDeclaration
one would write isRelationshipDeclaration(thing)
where:
RelationshipDeclaration.prototype._isRelationshipDeclaration = true;
var isRelationshipDeclaration = function isRelationshipDeclaration(obj) {
return obj instanceof RelationshipDeclaration || Boolean(obj._isRelationshipDeclaration);
};
module.exports = {
RelationshipDeclaration,
isRelationshipDeclaration
};
Importing Composer Concerto in various parts of the Accord Project (Ergo, Cicero, Cicero template library, template studio, etc.).
Describe the bug
Wrong package name.
The structure of the lerna packages in the code is:
concerto-core
concerto-tools
concerto-cli
But the package name (and the published package on npmjs) for concerto-core
is still concerto
. I think it would make sense to change that to avoid confusion, and align with other Accord Project packages structure/naming.
Corresponding line, I believe:
Is your feature request related to a problem? Please describe.
Now that Concerto has a TypeScript definition, #80 we need to make sure that it is kept up to date. Doing this automatically will be difficult because JS doesn't have all of the info required to generate TS definitions. However, we can alert developers who make API changes using the existing versionchecker.js
script.
Describe the solution you'd like
Extend the versionchecker.js
script to remind users who make API changes to also update the packages/concerto-core/types/index.d.ts
file.
The JS for the CTO parser is currently very large and should be optimised to make the web packed version of Concerto much smaller. The parser currently includes many pegjs rules inherited from JS that could be removed.
[74] ./lib/introspect/parser.js 545 KiB {0} [depth 3] [built]
This is also an opportunity to take a step back and evaluate other parser generators. I am particularly interested in being able to generate a CTO parser for other languages. E.g. Canopy supports Java, JS, Ruby and Python. ANLR4 (while written in Java) can also generate JS amongst many other languages: https://github.com/antlr/antlr4
References:
https://tomassetti.me/parsing-in-javascript/
https://en.wikipedia.org/wiki/Comparison_of_parser_generators
There's ambiguity in whether we should allow a class to override an identifying field declared in a super type.
For example, this code is currently disabled:
https://github.com/hyperledger/composer-concerto/blob/master/lib/introspect/classdeclaration.js#L201
Describe the bug
When an expression sets a value in the state to Infinity
, this gets serialized (through JSON.stringify
?) to null
. This has the effect of invalidating the state instance and rendering the contract unable to accept new requests.
The numbers Infinity and NaN, as well as the value null, are all considered null.
To Reproduce
Steps to reproduce the behavior:
infinity.ergo
namespace matt.inf
import org.accordproject.cicero.contract.*
import org.accordproject.cicero.runtime.*
contract Inf over InfContract {
clause infTest(request: Request): Response {
set state InfContractState {
stateId: "inf0",
value: 1.0 / 0.0
};
return Response{}
}
}
model.cto
namespace matt.inf
import org.accordproject.cicero.contract.* from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.cicero.runtime.* from https://models.accordproject.org/cicero/runtime.cto
asset InfContractState extends AccordContractState {
o Double value
}
asset InfContract extends AccordContract {}
state.json
{
"$class": "matt.inf.InfContractState",
"stateId": "state1",
"value": 0.0
}
contract.json
{
"$class": "matt.inf.InfContract",
"contractId": "contract1"
}
request.json
{
"$class": "org.accordproject.cicero.runtime.Request"
}
When you run ...
mattmbp:minimal matt$ ergorun execute --contract contract.json --request request.json --state state.json model.cto infinity.ergo
09:05:31 - info:
{
"clause": "mattXinfXInf",
"request": {
"$class": "org.accordproject.cicero.runtime.Request",
"transactionId": "54280e38-bfda-43f1-98d1-9048a64d7aeb",
"timestamp": "2019-08-16T08:05:31.493Z"
},
"response": {
"$class": "org.accordproject.cicero.runtime.Response",
"transactionId": "994be5fe-39b9-451e-9aa1-5e6a0fc90e3e",
"timestamp": "2019-08-16T08:05:31.504Z"
},
"state": {
"$class": "matt.inf.InfContractState",
"value": null,
"stateId": "inf0"
},
"emit": []
}
Notice the value of value
in the state response.
If you then update the value of state.json
with the new state, it will fail to pass validation.
mattmbp:minimal matt$ ergorun execute --contract contract.json --request request.json --state state.json model.cto infinity.ergo
09:05:41 - error: Instance matt.inf.InfContractState#state1 missing required field value
Expected behavior
The engine should throw a runtime error, perhaps similar to an enforce
response, to alert the client to the overflow and protect corruption of the state.
typo in readme (optionall)
typo free readme
has a typo
change the spelling
skimming through the readme
It would be lovely to have a code generator that generates an HTML form from a modelled type. The form should generate valid JSON for the type so that it can be used to create or update instances.
There is the start of such a thing here:
https://github.com/uchibeke/composer-form
The current JavaScript backend code generation expects JSON with a field containing null
for optional fields in the CTO model.
So for a concept:
concept C{
o Integer a optional
}
The expected serialization is currently:
{ "$class" : "C", "a" : null }
This is inconsistent with the way Concerto validates optional fields, instead assuming the default serialization is:
{ "$class" : "C" }
It would be useful to support both serialization in Ergo.
Note that it might be less confusing to Ergo user is the default Concerto serialization use the null
form, since in Ergo, you always have to write:
C{ a: none }
mkdirp
appears as a devDependency
but is needed at runtime in the filewriter.
One should be able to install and use composer-concerto without adding mkdirp
as a dependency themselves.
If installing composer-concerto without adding mkdirp
manually, node.js complains of a missing module.
Move mkdirp
from devDependencies
to dependencies
in the package.json
Using composer-concerto as part of the Ergo project https://github.com/accordproject/ergo
Describe the bug
The CLI (e.g., concerto generate
) fails on well formed and valid models from the Accord Project.
A clear and concise description of what the bug is.
To Reproduce
E.g., using examples from cicero-models:
bash-3.2$ cd ~/git/cicero-models/src/
bash-3.2$ concerto --version
0.80.4-20191003155034
bash-3.2$ concerto generate --ctoFiles signature/signature.cto
Class ContractSigned is not declared as abstract. It must define an identifying field. File 'signature/signature.cto': line 9 column 1, to line 11 column 2. IllegalModelException: Class ContractSigned is not declared as abstract. It must define an identifying field. File 'signature/signature.cto': line 9 column 1, to line 11 column 2.
bash-3.2$ concerto generate --ctoFiles cicero/contract.cto
Generated JSONSchema code.
bash-3.2$ concerto generate --ctoFiles cicero/runtime.cto
Class Request is not declared as abstract. It must define an identifying field. File 'cicero/runtime.cto': line 13 column 1, to line 13 column 23. IllegalModelException: Class Request is not declared as abstract. It must define an identifying field. File 'cicero/runtime.cto': line 13 column 1, to line 13 column 23.
bash-3.2$
Additional context
This is most likely due to distinct systems models. See also #62
Describe the bug
concerto-cli compile
command requires target
as argument but then uses argv.format
causing this error:
Unrecognized target: undefined
https://github.com/accordproject/concerto/blob/master/packages/concerto-cli/index.js#L82
Get a runtime failure because when we try to call the validate function on the Concerto object we are actually accessing the field.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.