diff --git a/README.md b/README.md index 130ef929a..906ea5916 100644 --- a/README.md +++ b/README.md @@ -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/ diff --git a/docs/_extensions/ghlink_check.py b/docs/_extensions/ghlink_check.py index 3d9dae6bd..0b28e8cd5 100644 --- a/docs/_extensions/ghlink_check.py +++ b/docs/_extensions/ghlink_check.py @@ -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')) diff --git a/docs/_extensions/specs.py b/docs/_extensions/specs.py index e269d7110..ff8cb1603 100644 --- a/docs/_extensions/specs.py +++ b/docs/_extensions/specs.py @@ -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}'), } diff --git a/docs/_links.rst b/docs/_links.rst index 65902d83e..27f3c27c2 100644 --- a/docs/_links.rst +++ b/docs/_links.rst @@ -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 diff --git a/docs/how-it-works.rst b/docs/how-it-works.rst index 001206669..414533e30 100644 --- a/docs/how-it-works.rst +++ b/docs/how-it-works.rst @@ -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. @@ -173,7 +173,7 @@ This order :apib:`exactly follows the API Blueprint specification `__ 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: @@ -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 ` -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 `__ 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 `__ 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). diff --git a/docs/how-to-guides.rst b/docs/how-to-guides.rst index d37d0efb1..9e3c06961 100644 --- a/docs/how-to-guides.rst +++ b/docs/how-to-guides.rst @@ -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 ` section, you can use ``required`` (:mson:`353-type-attribute`). -- In API Blueprint’s :apib:`Schema ` sections and in OpenAPI 2 you can use ``required`` (`spec `__), where you list the required properties. (Note this is true only for the `Draft v4 `__ JSON Schema, in older versions the ``required`` functionality was done differently.) +- In API Blueprint’s :apib:`Schema ` sections and in OpenAPI 2 you can use ``required`` (`spec `__), where you list the required properties. (Note this is true only for the `Draft v4 `__ JSON Schema, in older versions the ``required`` functionality was done differently.) Validating Structure of Array Items ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -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 ` 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 ` sections and in OpenAPI 2 you can use ``enum`` (`spec `__) with one or more possible values. +- In API Blueprint’s :apib:`Schema ` sections and in OpenAPI 2 you can use ``enum`` (`spec `__) with one or more possible values. Integrating Dredd with Your Test Suite -------------------------------------- @@ -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 ` 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 ` to overcome the OpenAPI 2 limitation: .. code-block:: openapi2 diff --git a/docs/internals.rst b/docs/internals.rst index dffcc217c..35eebe1ff 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -67,7 +67,7 @@ To hack Dredd locally, clone the repository and run ``npm install`` to install J Commit message format ~~~~~~~~~~~~~~~~~~~~~ -`Semantic Release `__ automatically manages releasing of new Dredd versions to the `npm `_ 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 `__: +`Semantic Release `__ automatically manages releasing of new Dredd versions to the `npm `_ 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 `__: .. code-block:: text @@ -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``` diff --git a/packages/dredd/lib/getProxySettings.js b/packages/dredd/lib/getProxySettings.js index 40fa58f9a..c2e7cd4ef 100644 --- a/packages/dredd/lib/getProxySettings.js +++ b/packages/dredd/lib/getProxySettings.js @@ -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)