orval-labs / orval

orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. 🍺
https://orval.dev
MIT License
2.81k stars 313 forks source link

MSW: Add "x-faker" support for yaml openapi yaml files #279

Open PeterMK85 opened 2 years ago

PeterMK85 commented 2 years ago

Question/Feature :) (checked issues, no references so far)

Example

What are the steps to reproduce this issue?

  1. Create a yaml declaration:
    "first_name": {
      "type": "string",
      "x-faker": "name.firstName"
    },
  2. If mock true in the orval.config.js
  3. The generated msw mocks should respect the x-faker value and directly set for the fields

What happens?

At the moment being ignored

What were you expecting to happen?

The generated msw mocks should respect the x-faker value from the yaml file declaration

Any logs, error output, etc?

-

Any other comments?

-

There is a possible mutator where the yaml file can be accessed?

What versions are you using?

Operating System:Package Version:Browser Version:

melloware commented 10 months ago

cc @Will-Mann-16