From: Kevin P. Fleming Date: Thu, 9 Apr 2026 11:28:49 +0000 (-0400) Subject: Complete the transition from Swagger to OpenAPI X-Git-Tag: auth-5.1.0-beta1~68^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd1e6ff88a7dd157ed354dd763d0e4e0c50a1431;p=thirdparty%2Fpdns.git Complete the transition from Swagger to OpenAPI Remove one remaining reference to Swagger in the documentation, and rename the API schema file to use 'openapi' instead of 'swagger'. These are all internal (build system and other) changes and should have no effect on users. Signed-off-by: Kevin P. Fleming --- diff --git a/.github/actions/problem-matchers/basic.json b/.github/actions/problem-matchers/basic.json index 336f0f567e..5e78030bc3 100644 --- a/.github/actions/problem-matchers/basic.json +++ b/.github/actions/problem-matchers/basic.json @@ -48,11 +48,11 @@ ] }, { - "owner": "pdns-swagger", + "owner": "pdns-openapi", "severity": "error", "pattern": [ { - "regexp": "(docs/http-api/swagger/.*\\.yaml)$", + "regexp": "(docs/http-api/openapi/.*\\.yaml)$", "file": 1 }, { diff --git a/.github/actions/spell-check/excludes.txt b/.github/actions/spell-check/excludes.txt index 587a8e61fb..accfafc2e7 100644 --- a/.github/actions/spell-check/excludes.txt +++ b/.github/actions/spell-check/excludes.txt @@ -94,7 +94,7 @@ SUMS$ ^codedocs/doxygen\.conf$ ^docs/depfile\.py$ ^docs/http-api/tsigkey\.rst$ -^docs/http-api/swagger/spectral-ruleset\.yaml$ +^docs/http-api/openapi/spectral-ruleset\.yaml$ ^docs/lua-records/reference/index\.rst$ ^modules/remotebackend/example\.rb$ ^modules/remotebackend/test-remotebackend-keys\.hh$ diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index 8d2979b932..5ff2ed38be 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -846,7 +846,7 @@ jobs: allow-empty: true fail-on-error: false - swagger-syntax-check: + openapi-syntax-check: if: ${{ (!github.event.schedule || vars.SCHEDULED_JOBS_BUILD_AND_TEST_ALL) && ! contains(needs.get-runner-container-image.outputs.id, 'debian-11') }} runs-on: ubuntu-24.04 needs: @@ -868,15 +868,15 @@ jobs: with: venv-parent: ${{ env.REPO_HOME }} working-directory: . - - run: ${{ env.INV_CMD }} install-swagger-tools - - run: ${{ env.INV_CMD }} swagger-syntax-check + - run: ${{ env.INV_CMD }} install-openapi-tools + - run: ${{ env.INV_CMD }} openapi-syntax-check collect: needs: - build-auth - build-dnsdist - build-recursor - - swagger-syntax-check + - openapi-syntax-check - test-auth-api - test-auth-backend - test-dnsdist-regression diff --git a/configure.ac b/configure.ac index fd895ba601..7e2d2adebf 100644 --- a/configure.ac +++ b/configure.ac @@ -129,8 +129,8 @@ PDNS_WITH_SQLITE3 PDNS_CHECK_PYTHON_VENV -AM_CONDITIONAL([HAVE_API_SWAGGER_JSON], [test -e "$srcdir/pdns/api-swagger.json"]) -AM_COND_IF([HAVE_API_SWAGGER_JSON],[],[ +AM_CONDITIONAL([HAVE_API_OPENAPI_JSON], [test -e "$srcdir/pdns/api-openapi.json"]) +AM_COND_IF([HAVE_API_OPENAPI_JSON],[],[ AM_COND_IF([HAVE_VENV],[],[ AC_MSG_ERROR([Python 3 and/or venv module are not available, Authoritative Server cannot be built.]) ]) diff --git a/docs/.gitignore b/docs/.gitignore index 068ae60c57..657ea6069f 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -19,6 +19,6 @@ html-docs.tar.bz2 /mans /mans.tmp /_build -/http-api/swagger/authoritative-api-schema.yaml +/http-api/openapi/authoritative-api-schema.yaml /sphinx.d /sphinx.stamp diff --git a/docs/Makefile.am b/docs/Makefile.am index c848dc3d36..aedd381bb7 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -51,7 +51,7 @@ man_MANS = $(MANPAGES_INSTALL) EXTRA_DIST = \ $(MANPAGES_DIST) \ - http-api/swagger/authoritative-api-swagger.yaml + http-api/openapi/authoritative-api-openapi.yaml if HAVE_VENV if !HAVE_MANPAGES @@ -88,13 +88,13 @@ if !HAVE_MANPAGES endif rm -rf mans -http-api/swagger/authoritative-api-schema.yaml: .venv generate-jsonschema.py http-api/swagger/authoritative-api-swagger.yaml - .venv/bin/python ./generate-jsonschema.py http-api/swagger/authoritative-api-swagger.yaml $@ +http-api/openapi/authoritative-api-schema.yaml: .venv generate-jsonschema.py http-api/openapi/authoritative-api-openapi.yaml + .venv/bin/python ./generate-jsonschema.py http-api/openapi/authoritative-api-openapi.yaml $@ -html-docs: common/** manpages/** .venv *.rst http-api/swagger/authoritative-api-schema.yaml +html-docs: common/** manpages/** .venv *.rst http-api/openapi/authoritative-api-schema.yaml .venv/bin/python -msphinx -b html . html-docs -latex/PowerDNS-Authoritative.pdf: common/** manpages/** .venv *.rst http-api/swagger/authoritative-api-schema.yaml +latex/PowerDNS-Authoritative.pdf: common/** manpages/** .venv *.rst http-api/openapi/authoritative-api-schema.yaml .venv/bin/python -msphinx -M latexpdf . . PowerDNS-Authoritative.pdf: latex/PowerDNS-Authoritative.pdf diff --git a/docs/Makefile.sphinx b/docs/Makefile.sphinx index 9d0426e302..56297ee173 100644 --- a/docs/Makefile.sphinx +++ b/docs/Makefile.sphinx @@ -12,14 +12,14 @@ BUILDDIR = _build help: .venv @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile.sphinx generate-jsonschema.py http-api/swagger/authoritative-api-swagger.yaml +.PHONY: help Makefile.sphinx generate-jsonschema.py http-api/openapi/authoritative-api-openapi.yaml -http-api/swagger/authoritative-api-schema.yaml: .venv generate-jsonschema.py http-api/swagger/authoritative-api-swagger.yaml - .venv/bin/python ./generate-jsonschema.py http-api/swagger/authoritative-api-swagger.yaml $@ +http-api/openapi/authoritative-api-schema.yaml: .venv generate-jsonschema.py http-api/openapi/authoritative-api-openapi.yaml + .venv/bin/python ./generate-jsonschema.py http-api/openapi/authoritative-api-openapi.yaml $@ # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile.sphinx .venv http-api/swagger/authoritative-api-schema.yaml +%: Makefile.sphinx .venv http-api/openapi/authoritative-api-schema.yaml @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .venv: diff --git a/docs/conf.py b/docs/conf.py index dca3258c43..f21a57b010 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -126,7 +126,7 @@ changelog_inner_tag_sort = [ changelog_hide_tags_in_entry = True # -- Options for the Sphinx-Immaterial JSON Domain ------------------------ -json_schemas = ["http-api/swagger/authoritative-api-schema.yaml"] +json_schemas = ["http-api/openapi/authoritative-api-schema.yaml"] # -- Options for the HTTP Domain ------------------------ # Because we use 'default' in the OpenAPI definition for responses, the HTTP domain @@ -174,7 +174,7 @@ redoc = [ { "name": "PowerDNS Authoritative API", "page": "http-api/redoc", - "spec": "http-api/swagger/authoritative-api-swagger.yaml", + "spec": "http-api/openapi/authoritative-api-openapi.yaml", "embed": True, "opts": { "native-scrollbars": True, diff --git a/docs/http-api/autoprimaries.rst b/docs/http-api/autoprimaries.rst index d92f093200..e557d5888a 100644 --- a/docs/http-api/autoprimaries.rst +++ b/docs/http-api/autoprimaries.rst @@ -6,7 +6,7 @@ This API is used to manage :ref:`autoprimaries `. Autoprimary endpoints --------------------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/autoprimaries /servers/{server_id}/autoprimaries/{ip}/{nameserver} :examples: diff --git a/docs/http-api/cache.rst b/docs/http-api/cache.rst index 755cdf00ac..e4ec07edd6 100644 --- a/docs/http-api/cache.rst +++ b/docs/http-api/cache.rst @@ -3,7 +3,7 @@ Cache Endpoints --------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/cache/flush :examples: diff --git a/docs/http-api/cryptokey.rst b/docs/http-api/cryptokey.rst index b2553fd5d7..8b46ca696d 100644 --- a/docs/http-api/cryptokey.rst +++ b/docs/http-api/cryptokey.rst @@ -4,7 +4,7 @@ Allows for modifying DNSSEC key material via the API. Endpoints --------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/zones/{zone_id}/cryptokeys /servers/{server_id}/zones/{zone_id}/cryptokeys/{cryptokey_id} :examples: diff --git a/docs/http-api/index.rst b/docs/http-api/index.rst index 3fda68cd99..3325f34592 100644 --- a/docs/http-api/index.rst +++ b/docs/http-api/index.rst @@ -319,8 +319,8 @@ Working with the API This chapter describes the PowerDNS Authoritative API. When creating an API wrapper (for instance when fronting multiple API's), it is recommended to stick to this API specification. -The API is described in the `OpenAPI format `_, also known as "Swagger", and this description is `available `_. It can also be obtained from a running server if the administrator of that server has enabled the API; it -is available at the `/api/docs` endpoint in both YAML and JSON formats (the 'Accept' header can be used to indicate the +The API is described in the `OpenAPI 3.1 format `_, and this description is `available `_. It can also be obtained from a running server if the administrator of that server has enabled the API; it +is available at the `/api/docs` endpoint in both YAML and JSON formats (the 'Accept' header can be used to indicate the desired format). Authentication diff --git a/docs/http-api/metadata.rst b/docs/http-api/metadata.rst index 1664c51b36..918a1515b7 100644 --- a/docs/http-api/metadata.rst +++ b/docs/http-api/metadata.rst @@ -3,7 +3,7 @@ Metadata Endpoints --------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/zones/{zone_id}/metadata /servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind} :examples: diff --git a/docs/http-api/networks.rst b/docs/http-api/networks.rst index 81341b2b5c..d14cf9d9e6 100644 --- a/docs/http-api/networks.rst +++ b/docs/http-api/networks.rst @@ -6,7 +6,7 @@ These endpoints allow configuration of networks, used by :doc:`../views`. Networks Endpoints ------------------ -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/networks /servers/{server_id}/networks/{ip}/{prefixlen} :examples: diff --git a/docs/http-api/swagger/authoritative-api-swagger.yaml b/docs/http-api/openapi/authoritative-api-openapi.yaml similarity index 100% rename from docs/http-api/swagger/authoritative-api-swagger.yaml rename to docs/http-api/openapi/authoritative-api-openapi.yaml diff --git a/docs/http-api/swagger/spectral-ruleset.yaml b/docs/http-api/openapi/spectral-ruleset.yaml similarity index 100% rename from docs/http-api/swagger/spectral-ruleset.yaml rename to docs/http-api/openapi/spectral-ruleset.yaml diff --git a/docs/http-api/search.rst b/docs/http-api/search.rst index 3c22d9a3c3..6897ba8d78 100644 --- a/docs/http-api/search.rst +++ b/docs/http-api/search.rst @@ -11,7 +11,7 @@ The API allows searching for data in :json:schema:`Zones `, :json:schema:` Endpoints --------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/search-data :examples: diff --git a/docs/http-api/server.rst b/docs/http-api/server.rst index 64aa7b6d42..2b5cb731c9 100644 --- a/docs/http-api/server.rst +++ b/docs/http-api/server.rst @@ -8,7 +8,7 @@ However, the API is written in a way that a proxy could be in front of many serv Endpoints --------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers /servers/{server_id} :examples: diff --git a/docs/http-api/statistics.rst b/docs/http-api/statistics.rst index 568bded97e..0176fd6755 100644 --- a/docs/http-api/statistics.rst +++ b/docs/http-api/statistics.rst @@ -4,7 +4,7 @@ Statistics Endpoints --------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/statistics :examples: diff --git a/docs/http-api/tsigkey.rst b/docs/http-api/tsigkey.rst index 4d5e45883a..b4c94accf5 100644 --- a/docs/http-api/tsigkey.rst +++ b/docs/http-api/tsigkey.rst @@ -7,7 +7,7 @@ TSIGKeys can be manipulated via the API. TSIGKey Endpoints ----------------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/tsigkeys /servers/{server_id}/tsigkeys/{tsigkey_id} :examples: diff --git a/docs/http-api/views.rst b/docs/http-api/views.rst index 8744977aa7..e04b08db3c 100644 --- a/docs/http-api/views.rst +++ b/docs/http-api/views.rst @@ -6,7 +6,7 @@ These endpoints allow configuration of per-zone :doc:`../views`. Views Endpoints --------------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/views /servers/{server_id}/views/{view} /servers/{server_id}/views/{view}/{id} :examples: diff --git a/docs/http-api/zone.rst b/docs/http-api/zone.rst index 32307f341a..99e69b4188 100644 --- a/docs/http-api/zone.rst +++ b/docs/http-api/zone.rst @@ -6,7 +6,7 @@ Manipulating zones is the primary use of the API. Zone Endpoints -------------- -.. openapi:: swagger/authoritative-api-swagger.yaml +.. openapi:: openapi/authoritative-api-openapi.yaml :paths: /servers/{server_id}/zones /servers/{server_id}/zones/{zone_id} /servers/{server_id}/zones/{zone_id}/axfr-retrieve /servers/{server_id}/zones/{zone_id}/notify /servers/{server_id}/zones/{zone_id}/export /servers/{server_id}/zones/{zone_id}/rectify :examples: diff --git a/lgtm.yml b/lgtm.yml index 67929165e2..1048b73c24 100644 --- a/lgtm.yml +++ b/lgtm.yml @@ -24,7 +24,7 @@ extraction: - "autoreconf -vi" - "./configure --with-modules='bind gsqlite3 gmysql gpgsql ldap'" - "pushd pdns" - - "touch .venv api-swagger.yaml api-swagger.json" + - "touch .venv api-openapi.yaml api-openapi.json" - "popd" index: build_command: diff --git a/meson.build b/meson.build index d9f1a60902..9c71800590 100644 --- a/meson.build +++ b/meson.build @@ -359,21 +359,21 @@ if not fs.is_file(libpdns_dnslabeltext_gen) libpdns_dnslabeltext_gen = ragel_generator.process(libpdns_dnslabeltext_source) endif -libpdns_apidocfiles_source = 'docs' / 'http-api' / 'swagger' / 'authoritative-api-swagger.yaml' +libpdns_apidocfiles_source = 'docs' / 'http-api' / 'openapi' / 'authoritative-api-openapi.yaml' libpdns_apidocfiles_gen = src_dir / 'apidocfiles.h' -generate_api_swagger_py = src_dir / 'generate-api-swagger.py' +generate_api_openapi_py = src_dir / 'generate-api-openapi.py' if not fs.is_file(libpdns_apidocfiles_gen) py = import('python') python = py.find_installation('python3', modules: 'yaml', required: true) - summary('Python', python.found(), bool_yn: true, section: 'Swagger API') - summary('Path', python.full_path(), section: 'Swagger API') - summary('Version', python.version(), section: 'Swagger API') + summary('Python', python.found(), bool_yn: true, section: 'Openapi API') + summary('Path', python.full_path(), section: 'Openapi API') + summary('Version', python.version(), section: 'Openapi API') libpdns_apidocfiles_gen = custom_target( 'pdns-apidocfiles-h', command: [python, '@INPUT0@', '@INPUT1@'], - input: [generate_api_swagger_py, libpdns_apidocfiles_source], + input: [generate_api_openapi_py, libpdns_apidocfiles_source], output: 'apidocfiles.h', capture: true, ) @@ -1186,13 +1186,13 @@ endif if python.found() json_schema = custom_target( 'auth-json-schema', - input: product_source_dir / docs_dir / 'http-api' / 'swagger' / 'authoritative-api-swagger.yaml', + input: product_source_dir / docs_dir / 'http-api' / 'openapi' / 'authoritative-api-openapi.yaml', output: 'auth-schema-generated.stamp', command: [ python, product_source_dir / docs_dir / 'generate-jsonschema.py', '@INPUT@', - product_source_dir / docs_dir / 'http-api' / 'swagger' / 'authoritative-api-schema.yaml', + product_source_dir / docs_dir / 'http-api' / 'openapi' / 'authoritative-api-schema.yaml', '--stampfile', '@OUTPUT@' ], diff --git a/pdns/.gitignore b/pdns/.gitignore index e00ce9a04b..36e6127d09 100644 --- a/pdns/.gitignore +++ b/pdns/.gitignore @@ -54,10 +54,10 @@ version_generated.h /calidns /dumresp /apidocfiles.h -/api-swagger.yaml -/api-swagger.json +/api-openapi.yaml +/api-openapi.json /.venv -/.swagger-api-venv +/.openapi-api-venv effective_tld_names.dat /dnsmessage.pb.cc /dnsmessage.pb.h diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 67665ba281..bd1db64ff6 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -46,14 +46,14 @@ AM_CPPFLAGS +=$(LIBSODIUM_CFLAGS) endif EXTRA_DIST = \ - api-swagger.json \ - api-swagger.yaml \ + api-openapi.json \ + api-openapi.yaml \ bindparser.hh \ convert-yaml-to-json.py \ dnslabeltext.cc \ dnslabeltext.rl \ dnsmessage.proto \ - generate-api-swagger.py \ + generate-api-openapi.py \ incfiles \ inflighter.cc \ ixfrdist.example.yml \ @@ -84,34 +84,34 @@ CLEANFILES = \ pdns.conf-dist \ apidocfiles.h -if !HAVE_API_SWAGGER_JSON +if !HAVE_API_OPENAPI_JSON # don't clean these files if they were present # at 'configure' time (e.g. from a source dist) CLEANFILES += \ - api-swagger.yaml \ - api-swagger.json + api-openapi.yaml \ + api-openapi.json endif # use a $(wildcard) wrapper here to allow build to proceed if output # file is present but input file is not (e.g. in a dist tarball) -api-swagger.yaml: $(wildcard ${srcdir}/../docs/http-api/swagger/authoritative-api-swagger.yaml) +api-openapi.yaml: $(wildcard ${srcdir}/../docs/http-api/openapi/authoritative-api-openapi.yaml) cp $< $@ if HAVE_VENV -api-swagger.json: api-swagger.yaml requirements.txt +api-openapi.json: api-openapi.yaml requirements.txt $(PYTHON) -m venv .venv .venv/bin/pip install -U pip "setuptools<82" .venv/bin/pip install -r ${srcdir}/requirements.txt .venv/bin/python ${srcdir}/convert-yaml-to-json.py $< $@ else # if HAVE_VENV -if !HAVE_API_SWAGGER_JSON -api-swagger.json: +if !HAVE_API_OPENAPI_JSON +api-openapi.json: echo "You need Python 3 and the 'venv' module to generate the JSON API document" exit 1 endif endif -apidocfiles.h: api-swagger.yaml api-swagger.json +apidocfiles.h: api-openapi.yaml api-openapi.json $(AM_V_GEN)$(srcdir)/incfiles $^ > $@.tmp @mv $@.tmp $@ diff --git a/pdns/generate-api-swagger.py b/pdns/generate-api-openapi.py similarity index 82% rename from pdns/generate-api-swagger.py rename to pdns/generate-api-openapi.py index 5371976f77..7be76b7430 100644 --- a/pdns/generate-api-swagger.py +++ b/pdns/generate-api-openapi.py @@ -1,4 +1,4 @@ -"""Produce API swagger YAML and JSON representations usable from C.""" +"""Produce API OpenAPI YAML and JSON representations usable from C.""" import json import sys @@ -35,8 +35,8 @@ with open(yaml_filename, mode="r", encoding="utf-8") as f_in: print(header) print() - dump_hex(yaml_contents, "api_swagger_yamlData", "g_api_swagger_yaml") + dump_hex(yaml_contents, "api_openapi_yamlData", "g_api_openapi_yaml") print() print("// -----------------------------------------------------------") print() - dump_hex(json_contents, "api_swagger_jsonData", "g_api_swagger_json") + dump_hex(json_contents, "api_openapi_jsonData", "g_api_openapi_json") diff --git a/pdns/recursordist/docs/Makefile.sphinx b/pdns/recursordist/docs/Makefile.sphinx index 2d90fd238e..c577e33e9c 100644 --- a/pdns/recursordist/docs/Makefile.sphinx +++ b/pdns/recursordist/docs/Makefile.sphinx @@ -12,10 +12,10 @@ BUILDDIR = _build help: .venv @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile.sphinx generate-jsonschema.py http-api/authoritative-api-swagger.yaml +.PHONY: help Makefile.sphinx generate-jsonschema.py http-api/authoritative-api-openapi.yaml -http-api/recursor-generated-schema.yaml: .venv generate-jsonschema.py http-api/authoritative-api-swagger.yaml - .venv/bin/python ./generate-jsonschema.py http-api/authoritative-api-swagger.yaml $@ +http-api/recursor-generated-schema.yaml: .venv generate-jsonschema.py http-api/authoritative-api-openapi.yaml + .venv/bin/python ./generate-jsonschema.py http-api/authoritative-api-openapi.yaml $@ # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/pdns/recursordist/docs/http-api/authoritative-api-openapi.yaml b/pdns/recursordist/docs/http-api/authoritative-api-openapi.yaml new file mode 120000 index 0000000000..c84f14983d --- /dev/null +++ b/pdns/recursordist/docs/http-api/authoritative-api-openapi.yaml @@ -0,0 +1 @@ +../../../../docs/http-api/openapi/authoritative-api-openapi.yaml \ No newline at end of file diff --git a/pdns/recursordist/docs/http-api/authoritative-api-swagger.yaml b/pdns/recursordist/docs/http-api/authoritative-api-swagger.yaml deleted file mode 120000 index b904e061f1..0000000000 --- a/pdns/recursordist/docs/http-api/authoritative-api-swagger.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../../docs/http-api/swagger/authoritative-api-swagger.yaml \ No newline at end of file diff --git a/pdns/recursordist/meson.build b/pdns/recursordist/meson.build index 897a78870b..e8c15027af 100644 --- a/pdns/recursordist/meson.build +++ b/pdns/recursordist/meson.build @@ -787,7 +787,7 @@ if python.found() command: [ python, product_source_dir / docs_dir / 'generate-jsonschema.py', - product_source_dir / docs_dir / 'http-api' / 'authoritative-api-swagger.yaml', + product_source_dir / docs_dir / 'http-api' / 'authoritative-api-openapi.yaml', product_source_dir / docs_dir / 'http-api' / 'recursor-generated-schema.yaml', '--stampfile', '@OUTPUT@' diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index dd35a996f0..f7002ba9f9 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -1126,13 +1126,13 @@ static bool isValidMetadataKind(const string& kind, bool readonly) void apiDocs(HttpRequest* req, HttpResponse* resp) { if (req->accept_yaml) { - resp->setYamlBody(g_api_swagger_yaml); + resp->setYamlBody(g_api_openapi_yaml); } else if (req->accept_json) { - resp->setJsonBody(g_api_swagger_json); + resp->setJsonBody(g_api_openapi_json); } else { - resp->setPlainBody(g_api_swagger_yaml); + resp->setPlainBody(g_api_openapi_yaml); } } diff --git a/tasks.py b/tasks.py index d438d7669d..a94ce06dde 100644 --- a/tasks.py +++ b/tasks.py @@ -1666,16 +1666,16 @@ def test_bulk_recursor(c, size, threads, mthreads, shards, ipv6): @task -def install_swagger_tools(c): +def install_openapi_tools(c): c.run("sudo apt-get update && sudo apt-get install -y npm") c.run("sudo mkdir -p /usr/local/lib/node_modules && sudo chmod 777 /usr/local/lib/node_modules") c.run("npm install -g @stoplight/spectral-cli") @task -def swagger_syntax_check(c): +def openapi_syntax_check(c): c.run( - "spectral lint --ruleset docs/http-api/swagger/spectral-ruleset.yaml --fail-severity error --display-only-failures docs/http-api/swagger/authoritative-api-swagger.yaml" + "spectral lint --ruleset docs/http-api/openapi/spectral-ruleset.yaml --fail-severity error --display-only-failures docs/http-api/openapi/authoritative-api-openapi.yaml" )