-
Notifications
You must be signed in to change notification settings - Fork 0
Codegen
André edited this page Dec 13, 2018
·
2 revisions
Model classes for the REST Api can be created with the help of Swagger
- get the swagger-codegen-cli.jar
- create a config file
config.json
with following content
{
"packageName" : "Processes.Proteus.Rest"
}
- start the vicci-runtime
- download swagger definition from
http://localhost:8082/api/swagger.json
or use the link as source in the following commands - create either only model code or all including REST client
java -Dmodels -jar swagger-codegen-cli.jar generate -i "swagger.json" -l csharp -o modelconfig -c config.json
java -jar swagger-codegen-cli.jar generate -i "swagger.json" -l csharp -o allconfig -c config.json
Swagger will create a lot of code and some code which you will probably not need. Perhaps you have to edit the created files afterwards and remove unused code.
There is a generator file which lets you generate the model classes in csharp.
- open account in genmymodel(should be free)
- create new EMF Project
- import the sofia.ecore file
- create new generator
- import the ecore2csharp.mtl generator code
- generate files
- edit manually the errors, which are caused by multiple inheritance (Identifiable, Nameable)