Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
fix(docs): fixes yarn docs:lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed May 9, 2024
1 parent 1d99cf0 commit db35c1f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ $ npm install -g dredd
[api blueprint]: https://apiblueprint.org/
[api blueprint tutorial]: https://apiblueprint.org/documentation/tutorial.html
[api blueprint examples]: https://github.com/apiaryio/api-blueprint/tree/master/examples
[openapi 2]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
[openapi 3]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md
[openapi 2]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
[openapi 3]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md
[documentation]: https://dredd.org/en/latest/
[changelog]: https://github.com/apiaryio/dredd/releases
[contributor's guidelines]: https://dredd.org/en/latest/contributing/
Expand Down
2 changes: 1 addition & 1 deletion docs/_extensions/ghlink_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_external(self):
self.assertTrue(check_uri('https://apiblueprint.org'))

def test_github(self):
self.assertTrue(check_uri('https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md'))
self.assertTrue(check_uri('https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md'))

def test_relevant_github_repo_but_irrelevant_path(self):
self.assertTrue(check_uri('https://github.com/apiaryio/dredd/issues/820'))
Expand Down
4 changes: 2 additions & 2 deletions docs/_extensions/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
SPECS = {
'apib': ('API Blueprint', 'https://apiblueprint.org/documentation/specification.html#{anchor}'),
'mson': ('MSON', 'https://apiblueprint.org/documentation/mson/specification.html#{anchor}'),
'openapi2': ('OpenAPI 2', 'https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#user-content-{anchor}'),
'openapi3': ('OpenAPI 3', 'https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#user-content-{anchor}'),
'openapi2': ('OpenAPI 2', 'https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md'), # TODO: re-add #{anchor}, fix yarn docs:lint
'openapi3': ('OpenAPI 3', 'https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#{anchor}'),
}


Expand Down
4 changes: 2 additions & 2 deletions docs/_links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

.. OpenAPI specification
.. _OpenAPI 2: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
.. _OpenAPI 3: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md
.. _OpenAPI 2: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
.. _OpenAPI 3: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md


.. JSON Schema
Expand Down
6 changes: 3 additions & 3 deletions docs/how-it-works.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ If Dredd isn’t able to infer any value for a required parameter, it will termi
Request Headers
~~~~~~~~~~~~~~~

In `OpenAPI 2`_ documents, HTTP headers are inferred from ``"in": "header"`` parameters (:openapi2:`parameterobject`). HTTP headers significant for content negotiation are inferred according to following rules:
In `OpenAPI 2`_ documents, HTTP headers are inferred from ``"in": "header"`` parameters (:openapi2:`parameter-object`). HTTP headers significant for content negotiation are inferred according to following rules:

- ``consumes`` (:openapi2:`swaggerconsumes`) is propagated as request’s ``Content-Type`` header.
- ``produces`` (:openapi2:`swaggerproduces`) is propagated as request’s ``Accept`` header.
Expand All @@ -173,7 +173,7 @@ This order :apib:`exactly follows the API Blueprint specification <relation-of-b
OpenAPI 2
^^^^^^^^^

The effective request body is inferred from ``"in": "body"`` and ``"in": "formData"`` parameters (:openapi2:`parameterobject`).
The effective request body is inferred from ``"in": "body"`` and ``"in": "formData"`` parameters (:openapi2:`parameter-object`).

If body parameter has ``schema.example`` (:openapi2:`schemaexample`), it is used as a raw JSON sample for the request body. If it’s not present, Dredd’s `OpenAPI 2 adapter <https://github.com/apiaryio/api-elements.js/tree/master/packages/openapi2-parser>`__ generates sample values from the JSON Schema provided in the ``schema`` (:openapi2:`parameterschema`) property. Following rules apply when the adapter fills values of the properties, ordered by precedence:

Expand Down Expand Up @@ -255,6 +255,6 @@ You can tell Dredd to use HTTP(S) proxy for:
- downloading API description documents (the positional argument :option:`api-description-document` or the :option:`--path` option accepts also URL)
- :ref:`reporting to Apiary <using-apiary-reporter-and-apiary-tests>`

Dredd respects ``HTTP_PROXY``, ``HTTPS_PROXY``, ``NO_PROXY``, ``http_proxy``, ``https_proxy``, and ``no_proxy`` environment variables. For more information on how those work see `relevant section <https://github.com/request/request#user-content-proxies>`__ of the underlying library’s documentation.
Dredd respects ``HTTP_PROXY``, ``HTTPS_PROXY``, ``NO_PROXY``, ``http_proxy``, ``https_proxy``, and ``no_proxy`` environment variables. For more information on how those work see `relevant section <https://github.com/request/request>`__ of the underlying library’s documentation.

Dredd intentionally **does not support HTTP(S) proxies for testing**. Proxy can deliberately modify requests and responses or to behave in a very different way then the server under test. Testing over a proxy is, in the first place, testing of the proxy itself. That makes the test results irrelevant (and hard to debug).
6 changes: 3 additions & 3 deletions docs/how-to-guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ If you describe a JSON body which has attributes ``name`` and ``size``, the foll
It’s because properties are optional by default in both `MSON`_ and `JSON Schema`_ and you need to explicitly specify them as required.

- In API Blueprint’s :apib:`Attributes <def-attributes-section>` section, you can use ``required`` (:mson:`353-type-attribute`).
- In API Blueprint’s :apib:`Schema <def-schema-section>` sections and in OpenAPI 2 you can use ``required`` (`spec <https://json-schema.org/understanding-json-schema/reference/object.html#required-properties>`__), where you list the required properties. (Note this is true only for the `Draft v4 <https://tools.ietf.org/html/draft-zyp-json-schema-04>`__ JSON Schema, in older versions the ``required`` functionality was done differently.)
- In API Blueprint’s :apib:`Schema <def-schema-section>` sections and in OpenAPI 2 you can use ``required`` (`spec <https://json-schema.org/understanding-json-schema/reference/object.html>`__), where you list the required properties. (Note this is true only for the `Draft v4 <https://tools.ietf.org/html/draft-zyp-json-schema-04>`__ JSON Schema, in older versions the ``required`` functionality was done differently.)

Validating Structure of Array Items
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -452,7 +452,7 @@ If you describe a JSON body which has attributes ``name`` and ``size``, the foll
If the size should be always equal to 300, you need to specify the fact in your API description.

- In API Blueprint’s :apib:`Attributes <def-attributes-section>` sections you can mark your property with ``fixed`` (:mson:`353-type-attribute`), which turns the sample value into a required value. You can also use ``enum`` (:mson:`212-structure-types`) to provide a set of possible values.
- In API Blueprint’s :apib:`Schema <def-schema-section>` sections and in OpenAPI 2 you can use ``enum`` (`spec <https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values>`__) with one or more possible values.
- In API Blueprint’s :apib:`Schema <def-schema-section>` sections and in OpenAPI 2 you can use ``enum`` (`spec <https://json-schema.org/understanding-json-schema/reference/enum>`__) with one or more possible values.

Integrating Dredd with Your Test Suite
--------------------------------------
Expand Down Expand Up @@ -732,7 +732,7 @@ Example Values for Request Parameters

While example values are natural part of the API Blueprint format, the OpenAPI 2 specification allows them only for ``body`` request parameters (``schema.example``).

However, Dredd needs to know what values to use when testing described API, so it supports ``x-example`` :openapi2:`vendor extension property <vendorextensions>` to overcome the OpenAPI 2 limitation:
However, Dredd needs to know what values to use when testing described API, so it supports ``x-example`` :openapi2:`vendor extension property <specification-extensions>` to overcome the OpenAPI 2 limitation:

.. code-block:: openapi2
Expand Down
6 changes: 3 additions & 3 deletions docs/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To hack Dredd locally, clone the repository and run ``npm install`` to install J
Commit message format
~~~~~~~~~~~~~~~~~~~~~

`Semantic Release <https://github.com/semantic-release/semantic-release>`__ automatically manages releasing of new Dredd versions to the `npm <https://www.npmjs.com/>`_ registry. It makes sure correct version numbers get increased according to the **meaning** of your changes once they are added to the ``master`` branch. This requires all commit messages to be in a specific format, called `Conventional Changelog <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#user-content--git-commit-guidelines>`__:
`Semantic Release <https://github.com/semantic-release/semantic-release>`__ automatically manages releasing of new Dredd versions to the `npm <https://www.npmjs.com/>`_ registry. It makes sure correct version numbers get increased according to the **meaning** of your changes once they are added to the ``master`` branch. This requires all commit messages to be in a specific format, called `Conventional Changelog <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md>`__:

.. code-block:: text
Expand Down Expand Up @@ -304,10 +304,10 @@ MSON spec
Simplifies linking the `MSON`_ spec. Usage: ``:mson:`353-type-attribute```

OpenAPI 2 spec
Simplifies linking the `OpenAPI 2`_ spec. Usage: ``:openapi2:`parameterobject```
Simplifies linking the `OpenAPI 2`_ spec. Usage: ``:openapi2:`parameter-object```

OpenAPI 3 spec
Simplifies linking the `OpenAPI 3`_ spec. Usage: ``:openapi3:`parameterobject```
Simplifies linking the `OpenAPI 3`_ spec. Usage: ``:openapi3:`parameter-object```

RFCs
Simplifies linking the RFCs. Not a custom extension in fact, this is provided by Sphinx out of the box. Usage: ``:rfc:`1855```
Expand Down
2 changes: 1 addition & 1 deletion packages/dredd/lib/getProxySettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const PROXY_ENV_VARIABLES = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'];
*
* Note: The settings are later only printed to the user. Applying the settings
* is handled directly by the 'request' library, see
* https://github.com/request/request#user-content-proxies
* https://github.com/request/request#proxies
*/
export default function getProxySettings(env) {
return Object.entries(env)
Expand Down

0 comments on commit db35c1f

Please sign in to comment.