Skip to content

Commit

Permalink
Merge pull request #979 from pmcelhaney/usage-guide-fixes.md
Browse files Browse the repository at this point in the history
fixes and enhancements to the usage documentation
  • Loading branch information
pmcelhaney authored Jul 4, 2024
2 parents 6183f42 + 63a6059 commit ff015ad
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 97 deletions.
6 changes: 3 additions & 3 deletions docs/usage-without-openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Running the server

If you don't have an OpenAPI document, you can still use Counterfact. You just won't have the benefit of code generation and you'll have to write your mocks by hand.
If you don't have an [OpenAPI document](https://swagger.io/specification/), you can still use Counterfact. You won't have the benefit of code generation and autocomplete in your IDE, but you can still use the API to write JavaScript code that is terse and intuitive.

If you run Counterfact without any arguments, it will run in "OpenAPI-free" mode.
If you run Counterfact without any arguments, it will run in "OpenAPI-free" mode. (Technically, under the covers, it uses an empty OpenAPI document.)

```sh
npx counterfact
Expand Down Expand Up @@ -40,6 +40,6 @@ For more information on the `$` object, see the [usage guide](./usage.md).

## Now that you know how to work without an OpenAPI doc, here's why you should have one anyway

OpenAPI is the de-facto standard for documenting REST APIs. Counterfact is just one of dozens of tools that use it. And if you pass Counterfact an OpenAPI doc, it will save you a lot of time by automatically generating default type-safe implementations of each API, with powerful context-sensitive autocomplete when you want to make changes.
OpenAPI is the de-facto standard for documenting REST APIs. Counterfact is just one of [hundreds of tools](https://openapi.tools/) that use it. And if you pass Counterfact an OpenAPI doc, it will save you a lot of time by automatically generating default type-safe implementations of each API, with powerful context-sensitive autocomplete when you want to make changes.

Not many people love writing documentation. Fewer people still love working on APIs that are not documented. Counterfact makes documentation useful, with immediate ROI, so that so that maintaining the docs is just as rewarding as writing code.
Loading

0 comments on commit ff015ad

Please sign in to comment.