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

Capi 23/fix/basic logging #6

Merged
merged 5 commits into from
Aug 31, 2016
Merged

Capi 23/fix/basic logging #6

merged 5 commits into from
Aug 31, 2016

Conversation

galaxie
Copy link

@galaxie galaxie commented Aug 29, 2016

Добавлено какое-никакое логирование и спеки.

@@ -17,6 +17,11 @@ request_params('{{operationId}}') ->
request_params(_) ->
error(unknown_operation).

-spec request_param_info(OperationID :: atom(), Name :: atom()) -> #{

Choose a reason for hiding this comment

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

Не проще ли на этом уровне ввести типы operation_id, parameter и т.д., да ещё возможно и экспортнуть их.

	Fix logging to use error_logger:msg functionality only.
	Refactor specs and missed spec.
	Add minor refactoring.
@@ -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),

Choose a reason for hiding this comment

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

Отступы в два пробела зачем-то.

@keynslug
Copy link

В остальном, :shipit:

@@ -113,7 +114,7 @@ populate_request_param(OperationID, Name, Req0, ValidatorState) ->

-spec validate_response(
OperationID :: operation_id(),
Code :: integer(),
Code :: non_neg_integer(),

Choose a reason for hiding this comment

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

200..599?

@keynslug
Copy link

:shipit:

@galaxie galaxie merged commit eb11639 into master Aug 31, 2016
galaxie added a commit that referenced this pull request Jan 20, 2017
* 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)
galaxie added a commit that referenced this pull request Jan 20, 2017
* CAPI-23 Add understandable messages in case of bad requests. Add specs to shut up dialyzer and add some minor code refactoring
@arentrue arentrue deleted the CAPI-23/fix/basic_logging branch May 24, 2017 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants