Skip to content

Commit 26cc2ff

Browse files
authored
Improve CONTRIBUTING.md (#344)
* Improve CONTRIBUTING.md * Load version from package.json
1 parent 0f0115b commit 26cc2ff

File tree

3 files changed

+12948
-49
lines changed

3 files changed

+12948
-49
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,37 @@ series [How to Contribute to an Open Source Project on GitHub][egghead]
3030
3131
Please make sure to run the tests (`npm test`) before you commit your changes.
3232
33+
### Local schemas
34+
35+
This repo supports OpenAPI 2.0 and 3.0. There are some real-world examples
36+
located in `tests/v2/specs/*.yaml` and `tests/v3/specs/*.yaml`, respectively.
37+
Testing large, real schemas was a major goal of this project. Many libraries
38+
only test the “Petstore” example from Swagger, which is contrived and is
39+
missing much complexity from companies’ production schemas.
40+
41+
_Note: don’t update the `yaml` schemas with your own custom additions (but if
42+
the official versions have updated, then it’s fine to upadte them here). If
43+
you’d like to add your schema for testing, then please add them as a new
44+
schema, and add them to `./expected/*.ts`._
45+
46+
#### Regenerating schemas
47+
48+
If you’ve added a feature or fixed a bug and need to update the generated schemas, run the following:
49+
50+
```
51+
# 1. re-build the package
52+
npm run build
53+
# 2. run the local CLI (not the npm one!)
54+
pkg/bin/cli.js tests/v3/specs/github.yaml -o tests/v3/expected/github.ts
55+
```
56+
57+
This should update the expected TypeScript definiton.
58+
59+
_Also if this appears in `examples/` feel free to update that, too!_
60+
3361
## Help needed
3462
35-
Please checkout the [the open issues][issues]. Issues labelled [**Help
63+
Please check out the [the open issues][issues]. Issues labelled [**Help
3664
Wanted**][help-wanted] and [**Good First Issue**][good-first-issue] are
3765
especially good to help with.
3866

bin/cli.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ Options
3737
}
3838
);
3939

40-
console.info(chalk.bold(`✨ openapi-typescript 2.2`));
40+
console.info(
41+
chalk.bold(`✨ openapi-typescript ${require("../package.json").version}`)
42+
);
4143

4244
const pathToSpec = cli.input[0];
4345
const timeStart = process.hrtime();

0 commit comments

Comments
 (0)