Skip to content

Conversation

@galaxie
Copy link

@galaxie galaxie commented Aug 29, 2016

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

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 и т.д., да ещё возможно и экспортнуть их.

@galaxie galaxie force-pushed the CAPI-23/fix/basic_logging branch from 95ac7fe to adb641b Compare August 30, 2016 13:11
	Fix logging to use error_logger:msg functionality only.
	Refactor specs and missed spec.
	Add minor refactoring.
@galaxie galaxie force-pushed the CAPI-23/fix/basic_logging branch from adb641b to a48143c Compare August 30, 2016 13:41
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:

-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.

3 participants