Skip to content

no 400 default response#31

Open
gsemet wants to merge 4 commits into
toumorokoshi:masterfrom
gsemet:clean_transmute
Open

no 400 default response#31
gsemet wants to merge 4 commits into
toumorokoshi:masterfrom
gsemet:clean_transmute

Conversation

@gsemet

@gsemet gsemet commented Nov 21, 2017

Copy link
Copy Markdown

No description provided.

Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
@coveralls

coveralls commented Nov 22, 2017

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 88.394% when pulling 175160a on Stibbons:clean_transmute into 5ef9277 on toumorokoshi:master.

@toumorokoshi

Copy link
Copy Markdown
Owner

@stibbons it's pretty guaranteed that it's possible to get a 400 response from a transmute API, as any violation of the schema will return that back as an error code.

How about an optional flag in the decorator instead? Or one can do global switches by modifying either the global (or passing in a new instance) of transmutecontext

@gsemet

gsemet commented Nov 23, 2017

Copy link
Copy Markdown
Author

Agree with the optional flag

@coveralls

coveralls commented Nov 23, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 88.418% when pulling 46d6428 on Stibbons:clean_transmute into 5ef9277 on toumorokoshi:master.

@toumorokoshi toumorokoshi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The code looks good, but I think you'll need to pipe that config through @Describe, by adding that option to TransmuteAttribute:

https://github.com/toumorokoshi/transmute-core/blob/master/transmute_core/decorators.py#L35

https://github.com/toumorokoshi/transmute-core/blob/master/transmute_core/attributes/__init__.py#L7

That gets wired into TransmuteFunction, which can then pull fields from that attributes struct and apply it to itself:

https://github.com/toumorokoshi/transmute-core/blob/master/transmute_core/function/transmute_function.py#L42

Also a unit test on this would be great!

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