Commit Graph

312 Commits

Author SHA1 Message Date
Adrien Marquès c7aa87c660
ignore EOF when parsing form as json 2020-03-20 22:18:34 +01:00
Adrien Marquès 0f62fc25a0
use request.URL.RequestURI() insteaf of request.RequestURI() ; it is not the same 2020-03-20 22:09:38 +01:00
Adrien Marquès 8c539370aa
remove cerr 2020-03-16 12:53:48 +01:00
Adrien Marquès acd0e73438
remove typecheck 2020-03-16 12:53:37 +01:00
Adrien Marquès b38a9a8111
refactor internal/reqdata to work with thew new config 2020-03-16 12:50:30 +01:00
Adrien Marquès 93b31b9718
keep references to Form parameters 2020-03-16 11:48:44 +01:00
Adrien Marquès 12417f7f1c
reference query parameters in config.Service 2020-03-16 11:32:37 +01:00
Adrien Marquès e7f10723a6
check for undefined brace captures + make tests parallel 2020-03-16 10:56:26 +01:00
Adrien Marquès c32b038da2
make splitURL public 2020-03-16 09:26:10 +01:00
Adrien Marquès 1b4922693b
move config -> internal.config and config.datatype to datatype 2020-03-16 09:20:00 +01:00
Adrien Marquès 4e0d669029
make config.Service members public 2020-03-16 09:01:51 +01:00
Adrien Marquès 2c1b9cf5ff
make captures public 2020-03-15 01:38:49 +01:00
Adrien Marquès d1ab4fefb0
add brace captures and check between param and pattern (keep them so no need to check them at each req) 2020-03-15 01:37:28 +01:00
Adrien Marquès 32aff3e07f
bcupdate: add service.Match, parameter.assignDataType, service.matchPattern, server.collide
continuous-integration/drone/push Build is failing Details
- datatype-s are required as arguments in Parse(), datatypes are built into the config parameters
 - collision detection compares : http method, pattern (both fixed, one/both captures)
 - test service.Match(); more to test
 - some refactor and fix tests
2020-03-15 00:27:54 +01:00
Adrien Marquès 6a144a9a93
rename Builder into semantic DataType 2020-03-14 16:16:30 +01:00
Adrien Marquès 511070196b
add validator to service input parameter
continuous-integration/drone/push Build is failing Details
2020-03-14 16:14:04 +01:00
Adrien Marquès e12c52b88f
migrate typecheck.builtin into config.datatype.builtin 2020-03-14 16:13:38 +01:00
Adrien Marquès 003fe4d2e7
create config.datatype replacing typecheck 2020-03-14 16:13:05 +01:00
Adrien Marquès a6f5083f0d
bcupdate: make config flat, rewrite, simplify, test 2020-03-14 15:24:17 +01:00
Adrien Marquès acdba4121b
rename ambiguous variable
continuous-integration/drone/push Build is passing Details
2020-03-09 19:12:26 +01:00
Adrien Marquès 43c758b615 Merge branch '0.2.0' of go/aicra into master
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details
2020-03-08 15:28:41 +00:00
Adrien Marquès 9103d752c3
upgrade go version to 1.14
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2020-03-08 16:26:56 +01:00
Adrien Marquès 1225e3b1f2
refactor server handler, rename for readability 2020-03-08 16:26:56 +01:00
Adrien Marquès 682e20a959
test primitive types : bool, float64 2020-03-08 16:26:56 +01:00
Adrien Marquès ec152aec4b
fix parsing primitive types instead of erroring unknown type 2020-03-08 16:26:56 +01:00
Adrien Marquès ccf6577bc5
test bool slice vs. json bool slice 2020-03-08 16:26:56 +01:00
Adrien Marquès 5dad0ecc39
test string slice vs. json string slice 2020-03-08 16:26:56 +01:00
Adrien Marquès 4cb62ea122
fix parsing non-string slice values
- only string were parsed using wrapped json
 - now we also keep primitive types
2020-03-08 16:26:56 +01:00
Adrien Marquès 313b91bb7f
remove outdated tests 2020-03-08 16:26:56 +01:00
Adrien Marquès 5741ec597b
[breaking] do not return first element of 1-sized slices as it, return a slice
- it is more consistent and does not rely of a "hidden" assomption.
 - for consistency, it is also a better practice to always  the same type when waiting to receive a slice ; the 1 element case should not break anything
2020-03-08 16:26:56 +01:00
Adrien Marquès 7e7eb3ac29
fix returning first element of 1-sized slice instead of the slice 2020-03-08 16:26:56 +01:00
Adrien Marquès e132a5af42
test conversion from 1-sized slice to first element (bool vs json boolean primitive) 2020-03-08 16:26:56 +01:00
Adrien Marquès 41d166529c
test json invalid float primitives ; only valid when wrapped 2020-03-08 16:26:56 +01:00
Adrien Marquès 45675713e7
fix formatting type 2020-03-08 16:26:56 +01:00
Adrien Marquès 0395d763d6
test json invalid boolean primitives ; only valid when wrapped 2020-03-08 16:26:56 +01:00
Adrien Marquès 4d663fc56c
test string slice as string ; invalid json but valid when wrapped 2020-03-08 16:26:56 +01:00
Adrien Marquès 43fb3bb7c9
test uint builtin typecheck overflow values for []byte 2020-03-08 16:26:55 +01:00
Adrien Marquès 8fbe3dc178
test regex for builtin string typecheck 2020-03-08 16:26:55 +01:00
Adrien Marquès 98878eb127
test simple string parameter 2020-03-08 16:26:55 +01:00
Adrien Marquès fab09b2a5b
fix: mark parameter as parsed after successful parsing
- avoid parsing multiple times in a row ; it has no side-effect but is useless
 - actually does not cause any issue, but for consistency sake!
2020-03-08 16:26:55 +01:00
Adrien Marquès b890fa0ccc
return error when parsing parameters 2020-03-08 16:26:55 +01:00
Adrien Marquès edc49d9915
expand store.go coverage to 100% with a tricky test
- force http.Request.ParseForm to fail
2020-03-08 16:26:55 +01:00
Adrien Marquès f076f3a88a
replace bytes.NewBufferString() with strings.NewReader() 2020-03-08 16:26:55 +01:00
Adrien Marquès 727737ae67
test multipart body paramters 2020-03-08 16:26:55 +01:00
Adrien Marquès f2423bd71a
make internal/multipart use internal/cerr constant errors
- instead of defining its own
2020-03-08 16:26:55 +01:00
Adrien Marquès 638f5e44c8
test internal/config trick to have a 100% coverage (as conflict check is undeterministic, merge all conditions) 2020-03-08 16:26:55 +01:00
Adrien Marquès 228f5b9a02
test internal/config empty parameter rename should not rename 2020-03-08 16:26:55 +01:00
Adrien Marquès aba95d4163
remove dead code 2020-03-08 16:26:55 +01:00
Adrien Marquès e9c7160d2e
expand internal/config test coverage
- make parameter type "?" invalid as it marks it as optional only
- check optional vs. required parameters
- test subservice in method description error check
2020-03-08 16:26:55 +01:00
Adrien Marquès 61b58a9f98
add internal/config test for the Browse() method 2020-03-08 16:26:55 +01:00