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

Support, openapi spec added #458

Closed
wants to merge 25 commits into from
Closed

Support, openapi spec added #458

wants to merge 25 commits into from

Conversation

Adityapanther
Copy link

issue fixed

#343
#47

Checklist

@Adityapanther Adityapanther changed the title Support openapi spec added Support, openapi spec added Aug 29, 2021
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

lib/validatorCompiler.js Show resolved Hide resolved
lib/validatorCompiler.js Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@Adityapanther
Copy link
Author

No, I removed

@kibertoad
Copy link
Member

Thank you! Can you add tests for new formats? Also CI is broken.

@Adityapanther
Copy link
Author

@kibertoad everything now good except CI, can you check CI because I have no experience with that or you can guide me for that

@kibertoad
Copy link
Member

@Adityapanther
Copy link
Author

ok, thanks

index.js Outdated Show resolved Hide resolved
lib/validatorCompiler.js Outdated Show resolved Hide resolved
test/validatorCompiler.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
lib/validatorCompiler.js Show resolved Hide resolved
lib/validatorCompiler.js Outdated Show resolved Hide resolved
lib/validatorCompiler.js Outdated Show resolved Hide resolved
test/validatorCompiler.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
})
ajv.addFormat('byte', {
type: 'string',
validate: byteValidation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At every validation execution, we are creating a new ajv instance and compilation.
We must avoid it.

If you precompile the functions, it should work as well

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you provide example

Adityapanther and others added 4 commits September 4, 2021 14:33
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
test/validatorCompiler.js Outdated Show resolved Hide resolved
test/validatorCompiler.js Outdated Show resolved Hide resolved
@Adityapanther
Copy link
Author

@mcollina no need to use fastify.inject in test

@mcollina
Copy link
Member

mcollina commented Sep 7, 2021

What this PR is missing to ship are a few tests, one for each of the new formats, that:

  1. create an endpoint that uses the selected format, inside the route it validates what is the payload that is sent
  2. performs a valid http request to the endpoint
  3. performs a http request that would fail validation

Thanks

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
test/validatorCompiler.js Outdated Show resolved Hide resolved
test/validatorCompiler.js Outdated Show resolved Hide resolved
Adityapanther and others added 2 commits September 7, 2021 15:07
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
@CarterLi
Copy link

Any progress?

@Adityapanther
Copy link
Author

I am currently busy with my company, I will update this sunday

@ec2ainun
Copy link

any update?

@CarterLi
Copy link

any update?

He said he would update it this sunday. Lets be patient

@ec2ainun
Copy link

any update?

He said he would update it this sunday. Lets be patient

okay im sorry, i'm new here, but i think its already a month isn't it? @CarterLi

@CarterLi
Copy link

any update?

He said he would update it this sunday. Lets be patient

okay im sorry, i'm new here, but i think its already a month isn't it? @CarterLi

I was joking...

@Adityapanther
Copy link
Author

@ec2ainun I am quite busy in my life I am trying to manage my work and personal life, if anyone free here he can provide update to this pull otherwise I will provide update after my project finish

@ec2ainun
Copy link

@Adityapanther sorry, i have little knowledge about openapi spec implementation, i just look around how to create good documentation in order to upload file using fastify, and i found this pull request in discussion

@Adityapanther
Copy link
Author

@mcollina please review

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not seem to include all the tests I asked before.

test/validatorCompiler.js Show resolved Hide resolved
@Adityapanther
Copy link
Author

@mcollina added use strict

@mcollina
Copy link
Member

What this PR is missing to ship are a few tests, one for each of the new formats, that:

  1. create an endpoint that uses the selected format, inside the route it validates what is the payload that is sent
  2. performs a valid http request to the endpoint
  3. performs a http request that would fail validation

Thanks

I think these tests are still missing.
CI is also failing.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants