Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Input format for Swagger file? #127

Open
vallamost opened this issue Jun 7, 2020 · 4 comments
Open

Input format for Swagger file? #127

vallamost opened this issue Jun 7, 2020 · 4 comments

Comments

@vallamost
Copy link

vallamost commented Jun 7, 2020

Hi,

[Windows 10 user]

I am trying to create a fastify app with this package but I am running into errors when trying to pass in the Swagger input file.

This is my input, the swagger.yaml file is in the Desktop folder before I try generating the project. The readme doesn't quite make it clear how to pass in the file. Any tips?

PS C:\Users\Mclovin\Desktop> fastify-app generate:project -d petstore
? Application name:  fastify-app
? Description:  A beautiful fastify app
? Author:
? Email:
? Version:  1.0.0
? Keywords:  fastify,nodejs
? License:  MIT
? Swagger File:  swagger.yaml
? Do you want generate Dockerfile and docker-compose.yml (y/n):  Y
generated package.json
generated help\start.txt
generated src\index.js
generated README.md
generated test\helper.js
generated src\hooks\onError.js
generated src\plugins\support.js
generated src\services\root.js
generated src\hooks\onRequest.js
generated src\hooks\preHandler.js
generated test\plugins\support.test.js
generated src\hooks\preParsing.js
generated test\services\example.test.js
generated src\hooks\onResponse.js
generated src\hooks\onSend.js
generated src\hooks\preSerialization.js
generated src\hooks\preValidation.js
generated src\plugins\README.md
generated src\services\README.md
generated test\services\root.test.js
generated src\services\hello\index.js
Error: Error parsing data
PS C:\Users\Mclovin\Desktop> dir

    Directory: C:\Users\Mclovin\Desktop

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----

...
d-----          6/7/2020  10:29 AM                petstore
-a----          6/7/2020  10:29 AM          17577 swagger.yaml
@davidedantonio
Copy link
Owner

Have you tried to provide the full path to swagger file? Honestly, I have never tested this functionality in a Windows environment!

@vallamost
Copy link
Author

vallamost commented Jun 9, 2020

Ah! It appears to work with the full path without quotes as seen below. Thanks for your help!

PS C:\Users\Mclovin\Desktop> fastify-app generate:project -d petstore1
? Application name:  fastify-app
? Description:  A beautiful fastify app
? Author:
? Email:
? Version:  1.0.0
? Keywords:  fastify,nodejs
? License:  MIT
? Swagger File:  "C:\Users\Mclovin\Desktop\swagger.yaml"
? Do you want generate Dockerfile and docker-compose.yml (y/n):  Y
generated README.md
generated package.json
generated help\start.txt
generated src\index.js
generated test\helper.js
generated src\hooks\onError.js
generated src\plugins\support.js
generated src\services\README.md
generated test\plugins\support.test.js
generated test\services\example.test.js
generated src\hooks\onRequest.js
generated src\hooks\onResponse.js
generated src\hooks\preHandler.js
generated src\hooks\onSend.js
generated src\hooks\preParsing.js
generated src\hooks\preSerialization.js
generated src\hooks\preValidation.js
generated src\plugins\README.md
generated src\services\root.js
generated test\services\root.test.js
generated src\services\hello\index.js
Error: Error parsing data
PS C:\Users\Mclovin\Desktop> fastify-app generate:project -d petstore2
? Application name:  fastify-app
? Description:  A beautiful fastify app
? Author:
? Email:
? Version:  1.0.0
? Keywords:  fastify,nodejs
? License:  MIT
? Swagger File:  C:\Users\Mclovin\Desktop\swagger.yaml
? Do you want generate Dockerfile and docker-compose.yml (y/n):  Y
generated package.json
generated README.md
generated help\start.txt
generated test\helper.js
generated src\index.js
generated test\services\example.test.js
generated test\plugins\support.test.js
generated src\hooks\onError.js
generated src\plugins\support.js
generated src\services\README.md
generated test\services\root.test.js
generated src\hooks\onResponse.js
generated src\hooks\onSend.js
generated src\hooks\onRequest.js
generated src\hooks\preHandler.js
generated src\hooks\preValidation.js
generated src\hooks\preParsing.js
generated src\hooks\preSerialization.js
generated src\plugins\README.md
generated src\services\root.js
generated src\services\hello\index.js
package.json generated successfully with given information
project fastify-app generated successfully
Dockerfile generated successfully
docker-compose.yml generated successfully
run 'cd petstore2'
run 'npm install'
run 'npm run dev' to start the application
PS C:\Users\Mclovin\Desktop>

@vallamost
Copy link
Author

Probably would be good to add this to the Readme for others that may use Windows :)

@vallamost vallamost reopened this Jun 9, 2020
@vallamost
Copy link
Author

vallamost commented Jun 12, 2020

FYI: :/

PS C:\Users\Mclovin\Desktop\petstore1> npm install
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for inotify@1.4.6: wanted {"os":"linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: linux
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants