Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with types generated from OpenAPI #2

Open
nirtamir2 opened this issue Sep 10, 2024 · 0 comments
Open

Work with types generated from OpenAPI #2

nirtamir2 opened this issue Sep 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nirtamir2
Copy link

Hi
I experiment using moquerie using one of my projects.
The UI looks beautiful and it seems useful - so thank you for your amazing work 💪

My config looks like:
moquerie.config.ts:

import { defineConfig } from "moquerie/config";

export default defineConfig({
  // API port
  server: {
    port: 4002,
  },
  rest: {
    typeFiles: ["src/lib/api/api.d.ts","src/lib/api/a.ts","src/lib/api/file.ts"],
  },
});

I generate types from my backend OpenAPI using openapi-typescript package. So I got a file named api.d.ts.

But when I try to import types from .d.ts it does not appear in the resources tab.

I have other few issues:

  • I created a file file.ts with export type Test = { a: number }; but I cannot see it in the resources tab. It only resolves interfaces, not types.
  • I cannot import stuff from api.d.ts

Is there an example of using it with .d.ts or the ability to resolve interfaces?
BTW - I couldn't find a way to reset my data in moqueire - so I cannot delete my mock / factory.

Thanks!

@Akryum Akryum added the enhancement New feature or request label Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants