question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to implement extended response

See original GitHub issue

Hello!

First of all, thank you for such a great library!

I have and old legacy API that returns responses like so:

{
    "type": "error",
    "kind": "validation",
    "message": { ... some message ...}  # this is built upon exception text
}

# or

{
    "type": "success",
    "result": { ... some data ...}  # this is what view returns
}

As you can see, the responses have envelope. Is it possible to implement such functionality in pythonic way still using @blp.response decorator?

Error condition can be determined on any exception (or specific like ValidationError to set kind and message fields) and on status method. Same for successful response.

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
lafrechcommented, Oct 1, 2018

0.9.0 released!

1reaction
asynceecommented, Sep 28, 2018

Great to hear! I think it is okay to use current code version and to not to push deeper (yet).

I think issue can be closed after release, i will integrate the code into existing project and test it, it may take some time.

Anyway for me this project is the best (compared to more mature projects), because it uses marshmallow and saves time on writing documentation.

Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How an Extended Response Item Can Enhance Learning
Teachers love extended response items because they require students to construct an in-depth response that proves mastery or lack thereof.
Read more >
Writing an Extended Response - YouTube
In this video, I explain the four steps to writing an extended response for the GED test:1. Read the passage.2. Plan your response.3....
Read more >
How to do an extended response exam - History Skills
How to do an extended response exam ; Contrast, Emphasise the differences ; Discuss, Examine by argument, considering for and against ; Explain,...
Read more >
Extended Constructed Response Prompts: 5 Steps for Success
On-demand writing prompts can be stressful and challenging for students. Use these five steps to create extended constructed response ...
Read more >
Writing and Answering Extended Response Questions
Practice. ▫ Share with a neighbor. Answer the following question with an extended response: ▫ What did you do this weekend?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found