Skip to content

Add warning / error when something else than YAML is passed #4

@noraj

Description

@noraj

I wanted to try the generator API so I installed it: npm i static-api-generator

I created a generator for my JSON data:

const API = require('static-api-generator');
const api = new API({
    addIdToFiles: true,
    blueprint: 'data/:page/:category',
    outputPath: 'temp/api/',
    pluralise: false
});
api.generate({
    endpoints: ['page', 'category']
});

then run it: node script.js.

And the result is that I have one char per entry:

And if I put addIdToFiles to false I have the whole content as one string

So it's like newline terminator are not properly detected.

I'm running it under archlinux with LN (\n) as final newline and utf-8 as charset. And I'm using node v10.0.0. All data files are JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions