Model Parser
The model parser takes files in various formats and converts them into a model.
Simple Model Syntax
This is our homegrown syntax for quickly creating a model.
The synatx is
{propertyName},{type_abbreviation}{?}{>}
the type abbreviation is the first character of the type (Except for double. We used d for date). You can also spell out types for any of your own classes or anything else.
? denotes nullable.
denotes it’s a collection.
id
name
duration
becomes
string Id
string Name
string Duration
id,i
names,s>
duration,l?
values,i?>
pets,Pet>
becomes
int Id
List<string> Names
List<long?> Duration
List<int?> Values
List<Pet> Pets
The list of types is
(s)tring
(i)nt
(d)ate
(u)niqueidentifier
(b)ool
(l)ong
doubl(e)
JSON
Any json file can be provided and we will do our best to convert it into a model.
TypeScript Class
We parse typescript classes that look like this. The TypeScript parsing is rudimentary.
export class Model {
entityId: string;
modelTypeId: string;
name: string;
parameters: string;
parsedModel: GenerationModelDefinition;
modelType: string;
constructor() {
this.entityId = "";
this.modelTypeId = "";
this.name = "";
this.parameters = "";
this.modelType = "";
this.parsedModel = new GenerationModelDefinition();
}
}
C# Class
We can parse C# POCOs. C# parsing is rudimentary.
public class QueryViewModel
{
public Guid EntityId { get; set; }
public string Name { get; set; }
public bool IsCommand { get; set; }
public List<ModelProperty>Request { get; set; }
public PropertyViewModel Response { get; set; }
}
Swagger Definition
Swagger definitions can be posted as JSON or Yaml and we also support loading from a url. So if you submit https://petstore.swagger.io/v2/swagger.json we will download that and process it for you.