We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First of all, thx for your greate tool. I'm playing arround with it and have a issue that i couldn't solve.
I read the article from CSS Tricks.
I create a source folder with the following structure:
source slogan1.yaml slogan2.yaml
the structure of slogan is only author: "Hugo" slogan: "Lorem ipsum ..."
I want to generate the following endpoint /slogans
The Code of my server.js:
server.js
const API = require('static-api-generator') const slogansAPI = new API({ blueprint: 'source/:slogan', outputPath: 'output' }) slogansAPI.generate({ endpoints: ['slogans'], })
After generating it with npm start I get 2 json files
Can you tell me what I'm doing wrong. The strange thing ist the content of slogans.json. It contains two result objects?
The content of .json seems right, but why is there no filename?
Content of slogans.json
{ "results": [ { "results": [ { "undefined_id": "10c8f19f2d98c3eb66ec911b5dc5abd0", "author": "Hugo", "title": "Lorem ipsum" }, { "undefined_id": "dfbdfa8f69d0b629153207a17e565fd9", "author": "Hugo", "slogan": "Lorem ipsum dolor" } ] } ], "metadata": { "itemsPerPage": 10, "pages": 1 } }
Content of .json
{ "results": [ { "undefined_id": "10c8f19f2d98c3eb66ec911b5dc5abd0", "author": "Hugo", "title": "Lorem ipsum" }, { "undefined_id": "dfbdfa8f69d0b629153207a17e565fd9", "author": "Hugo", "slogan": "Lorem ipsum dolor" } ], "metadata": { "itemsPerPage": 10, "pages": 1 } }
The text was updated successfully, but these errors were encountered:
I am having the same issue, can you please help me.
Sorry, something went wrong.
I'm having the same issue. And if I add another level, the json output doesn't contain anything.
I'm going to take a guess that static-api-generator always expects a collection and that collection has to be grouped by a folder.
As a temporary fix you could try using source/:slogans/:slogan and place all files in a sub folder source/slogans/.
source/:slogans/:slogan
source/slogans/
No branches or pull requests
First of all, thx for your greate tool. I'm playing arround with it and have a issue that i couldn't solve.
I read the article from CSS Tricks.
I create a source folder with the following structure:
the structure of slogan is only
author: "Hugo"
slogan: "Lorem ipsum ..."
I want to generate the following endpoint
/slogans
The Code of my
server.js
:After generating it with npm start I get 2 json files
Can you tell me what I'm doing wrong. The strange thing ist the content of slogans.json. It contains two result objects?
The content of .json seems right, but why is there no filename?
Content of slogans.json
Content of .json
The text was updated successfully, but these errors were encountered: