Skip to content
New issue

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

Can we integrate SWAGGER into it #22

Closed
panbhatt opened this issue Feb 26, 2019 · 9 comments
Closed

Can we integrate SWAGGER into it #22

panbhatt opened this issue Feb 26, 2019 · 9 comments
Labels
💡 Feature New feature or request

Comments

@panbhatt
Copy link
Contributor

Can we integrate SWAGGER into it

@benceHornyak
Copy link
Contributor

Yeah, I think so..
There is a plugin for it already: https://github.com/fastify/fastify-swagger

@panbhatt
Copy link
Contributor Author

Yes, I had done it in my last project.
Please let me know which branch to take the code from, I can commit it.

@Ethan-Arrowood
Copy link
Contributor

Hello @panbhatt I think Swagger would be a great integration. Fork this repository and make your changes from a new branch created off of 'master'. When you're ready to share your changes open a pull request. Thank you for your interest in contributing! Let me know if you need any other assistance.

@Ethan-Arrowood Ethan-Arrowood added the 💡 Feature New feature or request label Feb 27, 2019
@panbhatt
Copy link
Contributor Author

#23
Pull Request has been raised. Please review.

panbhatt pushed a commit to panbhatt/matterhorn that referenced this issue Mar 1, 2019
@panbhatt
Copy link
Contributor Author

panbhatt commented Mar 4, 2019

As per the latest build, npm run lint is failing. and giving error that Fastify is never being used.
Error: 2:13 error 'Fastify' is defined but never used no-unused-vars

import * as FastifySwagger from 'fastify-swagger'
import * as Fastify from 'fastify'
export function configureSwagger(fastifyInstance: Fastify.FastifyInstance )

we have two Options npm run lint pass : (this is a known problem in typescript-eslint-parser).
bradzacher/eslint-plugin-typescript#112
https://github.com/eslint/typescript-eslint-parser/issues/457
1.EIther make the type of FastifyInstance to Any. I do not think this is a good solution.
2. Change the typescript lint rules as suggested in the above two likes.

Please suggest what you thing is the most optimal way and I will go by that.

@panbhatt
Copy link
Contributor Author

panbhatt commented Mar 7, 2019

@Ethan-Arrowood : Any update for me which way you want it to go.

@Ethan-Arrowood
Copy link
Contributor

Tricky question @panbhatt I'm going to look into this and try to figure it out. I'll get back to you soon

@Ethan-Arrowood
Copy link
Contributor

Okay I found a solution, check out the review comments I left on your PR. More feedback coming soon too!

Ethan-Arrowood pushed a commit to panbhatt/matterhorn that referenced this issue Mar 11, 2019
Ethan-Arrowood pushed a commit that referenced this issue Mar 12, 2019
* Fastify Swagger implementaion has been done with Matterhorn.

Swagger interface will be available on the same port as that of Main Application with a path /documentation E.g. http://localhost:3000/documentation
A sample path /user/{id} has been created where a user can post a Object (user creation object as per the schema )and corresponding result will be returned.

* Adding the LINTING RULES.

* Added changes to make sure the tests are passing.

* Adding a new test case for #22 Issue.

* Adding back the properties required for Swagger documentation.
Removing extra fields from test.ts

* Changed Version of fastify-swagger to 2.3.2 to reduce the warnings of using unrelated properties in the schema.

* Adding the changes as suggested by ETHAN.

/* eslint-disable-next-line no-unused-vars */

* Added some more changes as suggested by Ethan. POST block is moved to configureSwaggerPlugin.

* update package-lock

* Closer to fixing the coverage ci issue

* solved issue

* fix spelling mistake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants