-
Notifications
You must be signed in to change notification settings - Fork 6
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
Capi 23/fix/basic logging #6
Conversation
@@ -17,6 +17,11 @@ request_params('{{operationId}}') -> | |||
request_params(_) -> | |||
error(unknown_operation). | |||
|
|||
-spec request_param_info(OperationID :: atom(), Name :: atom()) -> #{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не проще ли на этом уровне ввести типы operation_id
, parameter
и т.д., да ещё возможно и экспортнуть их.
95ac7fe
to
adb641b
Compare
adb641b
to
a48143c
Compare
@@ -28,12 +33,18 @@ authorize_api_key(From, KeyParam, OperationID, Req0, LogicHandler) -> | |||
end. | |||
|
|||
get_api_key(header, KeyParam, Req0) -> | |||
{Headers, Req} = cowboy_req:headers(Req0), | |||
{swagger_utils:get_opt({{packageName}}_utils:to_header(KeyParam), Headers), Req}; | |||
{Headers, Req} = cowboy_req:headers(Req0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отступы в два пробела зачем-то.
В остальном, |
@@ -113,7 +114,7 @@ populate_request_param(OperationID, Name, Req0, ValidatorState) -> | |||
|
|||
-spec validate_response( | |||
OperationID :: operation_id(), | |||
Code :: integer(), | |||
Code :: non_neg_integer(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
200..599
?
* Initial erlang generation * Recfactor erlang codegen to make a minimal working example * ft/erlang_codegen Separate handlers by resourse, add minor codegen fixes and refactoring * Test commit * ft/erlang_codegen Modify reouting generation * ft/erlang_codegen Remove parsed request concept. Add minor refactoring and bugfixes * ft/erlang_codegen Use swagger spec from an internal directory instead of a provided path * ft/erlang_codegen Add basic response validation * ft/erlang_codegen Moved all the req validators to a separate file for test needs * ft/erlang_codegen Add basic param validation * Add refactoring: OperationIDs are atoms now Fix schema validation Add todo list * CAPI-23 Add auth context to request handling (#2) * CAPI-23 Fix routing to support different paths in one handler. Add auth context to request handling. Add an opportunity to pass custom middlewares to the server * CAPI-31 Add enum validation and some minor fixes (#4) * CAPI-31 Fix turbo fuck up with additional params (#5) * Capi 23/fix/basic logging (#6) * CAPI-23 Add understandable messages in case of bad requests. Add specs to shut up dialyzer and add some minor code refactoring * CAPI-23 Fix missed bracket in auth module (#7)
* CAPI-23 Add understandable messages in case of bad requests. Add specs to shut up dialyzer and add some minor code refactoring
Добавлено какое-никакое логирование и спеки.