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

Ability to run Counterfact without OpenAPI #834

Closed
pmcelhaney opened this issue Apr 5, 2024 · 3 comments
Closed

Ability to run Counterfact without OpenAPI #834

pmcelhaney opened this issue Apr 5, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@pmcelhaney
Copy link
Owner

pmcelhaney commented Apr 5, 2024

Counterfact works fine without an OpenAPI description. It just won't generate code for you. You have to create JavaScript* files manually under the paths directory. The easiest way to implement is to supply an empty OpenAPI object if no file is given. In the CLI, a - can stand for the empty OpenAPI object.

npx counterfact - ./api 

The - could become the default value for the OpenAPI file path argument. If you're happy for files to be in the default location (the current working directory), it could be run with no arguments at all.

npx counterfact

*Either JavaScript or TypeScript would work, but TypeScript without the automatically generated types would not be fun.

@dethell
Copy link
Collaborator

dethell commented Apr 5, 2024

Running without OpenApi would easier with one of the archived recording features:

#451
or
#452

Then you could just turn on proxy, start recording, and have it build out your files (if not your types). Just mentioning here to possibly bump up those archived feature requests for later discussion.

@pmcelhaney
Copy link
Owner Author

Thanks. I reopened #452. At this point I don't have a clear vision of how to move forward with it. It may become clear after #723 is done.

@pmcelhaney
Copy link
Owner Author

This was implemented in 0.41.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants