Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit 4431938

Browse files
committed
Update README.md
1 parent c4830d7 commit 4431938

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Bookstore API
22

3-
Bookstore API built using Fastify and Typescript with Optic. Generates an OpenAPI spec using `@fastify/swagger` and tracks changes using Optic. To run this locally, you will need [node >= 16](https://nodejs.org/en) and [yarn](https://yarnpkg.com/getting-started/install).
3+
Bookstore API built using Fastify and Typescript with Optic. Generates an OpenAPI spec using `@fastify/swagger` and tracks changes using Optic. We have set up Optic to:
4+
- [preview API changes in PRs](#preview-api-changes-in-prs)
5+
- [test for breaking changes](https://github.com/opticdev/bookstore-api/pull/1)
6+
- [enforce the API style guide](https://github.com/opticdev/bookstore-api/pull/3)
7+
- [share our API changelog and documentation with consumers](#accurate-documentation-and-changelogs)
8+
9+
Take a look at the guides or just dig around the repo. You can start a server or generate an OpenAPI spec from the code.
10+
11+
## Running this repo locally
12+
13+
To run this locally, you will need [node >= 16](https://nodejs.org/en) and [yarn](https://yarnpkg.com/getting-started/install).
414

515
Get started by installing dependencies:
616

@@ -9,3 +19,31 @@ Get started by installing dependencies:
919
And then run one of the following commands:
1020
- `yarn start:local` - starts the server
1121
- `yarn generate-spec` - generates an OpenAPI spec from code definitions
22+
23+
## Preview API changes in PRs
24+
25+
Take a look at the [open pull requests of the repo](https://github.com/opticdev/bookstore-api/pulls). It's difficult to know how the code changes will impact your API. Optic adds preview documentation and an API changelog to each PR so every developer on your team knows exactly what changes to the API have been proposed.
26+
27+
Here are a couple of examples of what Optic can do:
28+
- [Optic caught a breaking change](https://github.com/opticdev/bookstore-api/pull/1)
29+
- A small line of code can change multiple endpoints. [Optic makes it easy to see the effective API changes being proposed](https://github.com/opticdev/bookstore-api/pull/2)
30+
- [Adding 2 new query parameters that do not follow our team's naming conventions](https://github.com/opticdev/bookstore-api/pull/3)
31+
32+
## Accurate documentation and changelogs
33+
34+
Every time this repositories main branch is updated, a new version of your API is pushed to Optic. Developers on your team, or your consumers (if public), can see a complete API changelog, and accurate documentation for the API.
35+
36+
- [View the Optic Changelog](https://app.useoptic.com/organizations/32613bcd-704e-4661-85f0-7b3d75613fb0/apis/Ru2Me4G-2nIro-cj4Bbib)
37+
![optic changelog](/images/changelog.png)
38+
- [View diffs between different API versions](https://app.useoptic.com/organizations/32613bcd-704e-4661-85f0-7b3d75613fb0/apis/Ru2Me4G-2nIro-cj4Bbib/operations/get.%2Fauthors%2F%7BauthorId%7D?diffTag=fyXT_OAvfLfjlipBFl2Xw)
39+
![diff two versions](/images/diff-versions.png)
40+
- [Preview documentation and changes in pull requests](https://github.com/opticdev/bookstore-api/pull/2#issuecomment-1613615164)
41+
![preview changes](/images/preview-changes.png)
42+
43+
You can also add badges to your repository that show you how often your API is changing and the number of endpoints you have.
44+
45+
[![Optic badge of documentation](https://app.useoptic.com/organizations/32613bcd-704e-4661-85f0-7b3d75613fb0/public/apis/Ru2Me4G-2nIro-cj4Bbib/badge.svg?type=documentation&code=O3UVmk3goSaVOxxbSTHxu.hiMaTkrqNRj8dEb41awZRxdn0iUZ9UhT)](https://app.useoptic.com/organizations/32613bcd-704e-4661-85f0-7b3d75613fb0/apis/Ru2Me4G-2nIro-cj4Bbib?ref=badge) [![Optic badge of changes](https://app.useoptic.com/organizations/32613bcd-704e-4661-85f0-7b3d75613fb0/public/apis/Ru2Me4G-2nIro-cj4Bbib/badge.svg?type=changes&code=a5dN_bRR7n6-MEutVOj8f.jdaniuNKGOz-CgAf_R5YfQIR3UvNYcWK)](https://app.useoptic.com/organizations/32613bcd-704e-4661-85f0-7b3d75613fb0/apis/Ru2Me4G-2nIro-cj4Bbib?ref=badge)
46+
47+
## Set up Optic Cloud
48+
49+
You can follow instructions on how to set up Optic Cloud on [our website](https://www.useoptic.com/docs/cloud-get-started). If you generate an OpenAPI spec from your code (just like this repo), you should follow our [generated spec set up guide](https://www.useoptic.com/docs/setup-ci-generated).

images/changelog.png

222 KB
Loading

images/diff-versions.png

328 KB
Loading

images/preview-changes.png

101 KB
Loading

0 commit comments

Comments
 (0)