killgrave icon indicating copy to clipboard operation
killgrave copied to clipboard

Add missing imposters validation

Open joanlopez opened this issue 1 year ago • 8 comments

There are edge cases that aren't properly handled, that should be reviewed and managed adequately. For instance, what if the response field is empty, or it's an empty or null array.

We should try to:

  • List all the possible edge cases first
  • Define how these should be managed (errors, etc)
  • Adjust existing tests accordingly, add new ones.

joanlopez avatar Apr 11 '24 05:04 joanlopez

Hey @joanlopez does this issue still need to be worked on? Will be happy to contribute if this still needs to be worked on.

yumski avatar May 26 '24 03:05 yumski

Hey @yumski,

Sure, yes - please do it. I can even try to bring some help if needed. As suggested, I'd start by going over the code base and different features, and try to build a list. Then, we can analyze what would make sense and what not.

Thanks! 🙇🏻

joanlopez avatar May 27 '24 06:05 joanlopez

Hey @joanlopez,

I'd like to contribute to this project. Is this still being worked on? If yes I'll try making a list of edge cases.

npsolver avatar Jul 25 '24 01:07 npsolver

I'd like to contribute to this project. Is this still being worked on? If yes I'll try making a list of edge cases.

Of course! I haven't seen any progress from @yumski, so feel free to start working on it!

joanlopez avatar Jul 25 '24 07:07 joanlopez

Hey @joanlopez,

I was going through the code and how the components work. I was trying out building a test server using the files under the folder internal/server/http/test/testdata/. But when I tested the endpoint /gophers it gave me:

2024/07/27 19:08:21 stat schemas/create_gopher_request.json: no such file or directory: the schema file schemas/create_gopher_request.json not found

whereas the file does exist. I'm not sure what the fix for this is. Can I get some help? Thanks.

npsolver avatar Jul 27 '24 23:07 npsolver

Hey @npsolver, It looks like you caught a bug from one of our recent refactors, where we eliminated the afero dependency. Thanks for reporting it! Changes on #173 should make it work! 💪🏻

joanlopez avatar Jul 29 '24 08:07 joanlopez

Hey @joanlopez, found a typo here: https://github.com/friendsofgo/killgrave/blob/bca67fd6ef0d38bb185e84792007289be2ded513/internal/server/http/route_matchers.go#L58 The _ should be replaced with err.

npsolver avatar Aug 11 '24 02:08 npsolver

Hey @joanlopez, found a typo here:

https://github.com/friendsofgo/killgrave/blob/bca67fd6ef0d38bb185e84792007289be2ded513/internal/server/http/route_matchers.go#L58

The _ should be replaced with err.

Great catch @Npsolver, I have added it as part of https://github.com/friendsofgo/killgrave/pull/173. Thanks for pointing out!

joanlopez avatar Aug 12 '24 08:08 joanlopez