Generator parameters
When starting a generator, Lysis provides an object as parameter containing:
rawApi
: the raw API result, from parseHydraDocumentation.context
: the API result enhanced, ready to use in templates to generate files.config
: the API configuration from the YAML file.generatorConfig
: the generator configuration, still from the YAML file.
Context
The context is an object with:
entrypoint
: the entrypoint URI, i.e. the API URItitle
: the API titleresources
: an object containing the API resources, as (resource name => resource properties)
Resource properties
name
: the resource name, for examplebooks
title
: the resource title, for exampleBook
url
: the resource URL, for examplehttp://127.0.0.1:8000/books
fields
: the resource fields, as (field name => field properties)
Field properties
name
: the field name, for exampleid
description
: the field descriptiontype
: an object containing type propertiesrequired
: a booleanreadable
: a booleanwritable
: a boolean
Type properties
type
:scalar
:range
:id
:resource
:
The type is:
- integer
- decimal
- string
- boolean
- date
- time
- dateTime
- url
- bla bla type...
Config
It is an object containing:
basePath
: the base directory, in which create sub directories and write fileshydraPrefix
: the hydra prefix, mostly used to retrieve field documentation.
GeneratorConfig
It is an object, it depends on your generator.