Git Product home page Git Product logo

Comments (15)

Priddles avatar Priddles commented on September 26, 2024 1

@Priddles is it just a matter of looping over the responses array and generating for each?

Yes, I'd say so.

Some level of deduplication would be good, but definitiely a nice-to-have.

from orval.

melloware avatar melloware commented on September 26, 2024 1

Ok assigned the ticket to you.

from orval.

melloware avatar melloware commented on September 26, 2024 1

Yes @TommoLeedsy PR would be great.

from orval.

melloware avatar melloware commented on September 26, 2024 1

Let me find out

from orval.

melloware avatar melloware commented on September 26, 2024

Similar to this issue: #1280

from orval.

melloware avatar melloware commented on September 26, 2024

Isn't this https://orval.dev/reference/configuration/output#generateeachhttpstatus

The setting to generate for each HTTP status?

from orval.

Priddles avatar Priddles commented on September 26, 2024

@melloware That is a config option for the mocks, and it does not affect zod generation as far as I can tell.

from orval.

melloware avatar melloware commented on September 26, 2024

Reopened i thought it did it for mocks and zod. I see now its just mocks.

from orval.

melloware avatar melloware commented on September 26, 2024

You are right the code is only doing 200

const response = spec?.[verb]?.responses?.['200'] as
    | ResponseObject
    | ReferenceObject;

from orval.

melloware avatar melloware commented on September 26, 2024

@Priddles is it just a matter of looping over the responses array and generating for each?

from orval.

TommoLeedsy avatar TommoLeedsy commented on September 26, 2024

@melloware I have a fix for this locally and will put a PR in tomorrow.

from orval.

Priddles avatar Priddles commented on September 26, 2024

@melloware @TommoLeedsy Thanks for the quick turnaround!

I saw it got released so I tried it out, but having some issues. Wasn't sure whether to open a new issue or not so putting it here.

I have a minimal reproducible example here.

The issues are:

  1. It seems to be reading the config from the wrong object.
  2. It generates a lot of MSW and Faker related code that has nothing to do with Zod.

from orval.

melloware avatar melloware commented on September 26, 2024

I would open a new ticket.

from orval.

TommoLeedsy avatar TommoLeedsy commented on September 26, 2024

@Priddles Sorry yeah that's my mistake, I didn't realise I needed to add a new config option and just used an existing one instead. I have now added generateEachHttpStatus to the zod options. This should sort it. I can put a PR in today?

from orval.

Priddles avatar Priddles commented on September 26, 2024

@melloware Do you know when the fix might be released?

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.