Git Product home page Git Product logo

Comments (6)

soartec-lab avatar soartec-lab commented on September 26, 2024

@karlismelderis-mckinsey

The generateEachHttpStatus option allows you to generate each http response that you define as a schema within OpenAPI. Does it solve your question?

from orval.

AffeJonsson avatar AffeJonsson commented on September 26, 2024

I think this is similar to #1318, do you have any use case outside of when an endpoint returns a oneOf response? The linked pr solves that use case in the next release

from orval.

karlismelderis-mckinsey avatar karlismelderis-mckinsey commented on September 26, 2024

our use-case is testing of BE services
we can easily reuse faker data for plenty of service code tests and in rare cases where Schema is missing we can always inject required schema to generate faker

Beauty of our situation is that we are attaching Swagger decorators to every key out of the box due to reusable decorators within our code and even internal data structures end up having Swagger schema if needed

but because tests don't think about Request/Response it would be very weird for back-end developers to use getShoppingCartControllerGetByIdResponseMock instead of shoppingCartDtoMock

from orval.

karlismelderis-mckinsey avatar karlismelderis-mckinsey commented on September 26, 2024

Also currently Orval is generating only faker code for Response but many our test cases would benefit from access to request mock

that would allow us to replace huge pile of static test data with generated faker code

from orval.

soartec-lab avatar soartec-lab commented on September 26, 2024

@karlismelderis-mckinsey
well, i don't think about backend testing. I wanna more understand, so could you show me some sample code for testing ?

from orval.

karlismelderis-mckinsey avatar karlismelderis-mckinsey commented on September 26, 2024

Let's narrow down the scope for our ask

if Orval can generate faker code to cover Request Schema that will help us to generate data for e2e/black-box tests

anything we need for integration/unit tests we will solve differently not to couple things up to much

from orval.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.