n4js.README.mustache Maven / Gradle / Ivy
# Documentation for {{appName}}
- API version: {{appVersion}}
{{^hideGenerationTimestamp}}
- Build date: {{generatedDate}}
{{/hideGenerationTimestamp}}
{{{appDescriptionWithNewLines}}}
{{#infoUrl}}
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
## Getting started
Configure the following elements:
- In open-api-n4js.yaml please add under 'additionalProperties':
- property 'fetchExecuterConstName'
- property 'fetchExecuterConstImplPath'
- The generated output directory needs to be augmented with an implementing n4js file
## Example
**open-api-n4js.yaml**
```yaml
generatorName: n4js
outputDir: /working_dir/gen-n4js/
inputSpec: /working_dir/api-spec/main.yaml
templateDir: /openapi-generator/modules/openapi-generator/src/main/resources/n4js
additionalProperties:
fetchExecuterConstName: "FETCH_EXEC"
fetchExecuterConstImplPath: "FetchExecuterImpl"
```
**FetchExecuterImpl.n4js**
```typescript
import {FetchExecuterI} from "api/ApiHelper";
export public const FETCH_EXEC = new FetchExecuterMock();
export public class FetchExecuterMock implements FetchExecuterI {
@Override
public async run(
path: string,
query: ~Object=,
reqInit: ~Object= {}): ~Object with {get status() : number, json(): Promise} {
return null;
}
}
```