Skip to content

Commit 097ee45

Browse files
authored
Merge pull request #4027 from OAI/markdown-style-guide
Add markdown style guide to CONTRIBUTING
2 parents fd83327 + 0304666 commit 097ee45

File tree

4 files changed

+1344
-516
lines changed

4 files changed

+1344
-516
lines changed

.markdownlint.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Unordered list symbol
2+
MD004:
3+
style: asterisk
4+
5+
# Unordered list indentation
6+
MD007:
7+
indent: 2
8+
9+
MD012: false # allow blank lines
10+
11+
MD013:
12+
line_length: 800
13+
tables: false
14+
15+
MD024: false # duplicate headings
16+
MD033: false # inline HTML

CONTRIBUTING.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,35 @@ Schemas are only changed _after_ the specification is changed. Changes are made
3535

3636
* Issue #3576: [What is our authoritative spec URL and how do people find it?](https://github.com/OAI/OpenAPI-Specification/issues/3576)
3737

38+
## Style Guide
39+
40+
Contributions to this repository should follow the style guide as described in this section.
41+
42+
### Markdown
43+
44+
Markdown files in this project should follow the style enforced by the [markdownlint tool](https://www.npmjs.com/package/markdownlint),
45+
as configured by the `.markdownlint.json` file in the root of the project.
46+
47+
The following additional rules should be followed but currently are not enforced by tooling:
48+
49+
1. The first mention of a normative reference or an OAS-defined Object in a (sub)*section is a link, additional mentions are not
50+
2. OAS-defined Foo Bar Objects are written in this style, and are not monospaced
51+
3. "example" instead of "sample" - this spec is not about statistics
52+
4. Use "OpenAPI Object" instead of "root"
53+
5. Fixed fields are monospaced
54+
6. Field values are monospaced in JSON notation: `true`, `false`, `null`, `"header"` (with double-quotes around string values), ...
55+
7. A combination of fixed field name with example value uses JS notation: `in: "header"`, combining rules 5 and 6
56+
8. An exception to 5-7 is colloquial use, for example "values of type `array` or `object`" - "type" is not monospaced, so the monospaced values aren't enclosed in double quotes.
57+
9. Use Oxford commas, avoid Shatner commas.
58+
10. Use `<span id="thing"></span>` for link anchors. The `<a name="thing"></a>` format has been deprecated.
59+
60+
### Use of "keyword", "field", "property", and "attribute"
61+
62+
* JSON Schema keywords -> "keyword"
63+
* OpenAPI fixed fields -> "field"
64+
* property of a "plain" JSON object that is not an OpenAPI-defined Foo Object -> "property"
65+
* "attribute" is only used in the XML context and means "XML attribute"
66+
3867
## Release Process and Scope
3968

4069
* Issue #3528: [3.x.y patch release approach](https://github.com/OAI/OpenAPI-Specification/issues/3528)
@@ -95,7 +124,7 @@ The OpenAPI Initiative uses GitHub Projects to manage work _outside_ of the spec
95124

96125
### Discussions
97126

98-
We are beginning (as of mid-2024) to use GitHub [discussions](https://github.com/OAI/OpenAPI-Specification/discussions?discussions_q=is%3Aopen) for open-ended topics such as major enhancements.
127+
We are beginning (as of mid-2024) to use GitHub [discussions](https://github.com/OAI/OpenAPI-Specification/discussions?discussions_q=is%3Aopen) for open-ended topics such as major enhancements.
99128

100129
* Issue #3518: [Define criteria for filing/closing issues vs discussions](https://github.com/OAI/OpenAPI-Specification/issues/3518)
101130

0 commit comments

Comments
 (0)