OpenAPI (Swagger) documentation does not take into account the routes hostname
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
レポートで説明されている tenant と main-domain の API ドキュメントを使用し、ApiResource のホストメタデータに対する OpenAPI ドキュメント生成のエントリーポイントから開始します。両方のホストについて生成された仕様を比較します。完了の条件は、ホストに制限されたエンドポイントが tenant のドキュメントから除外され、server URL が該当するホストを反映していることです。
索引モデルが issue の本文から書いたものです。
説明
API Platform version(s) affected: ^3.1
Description
I have endpoints that needs to be accessible from different hosts for a multi-tenant app.
On the main domain (example.com/api), there are common data endpoints.
For tenant subdomain (tenant_identifier.example.com/api), there are the tenant data endpoints.
I tried to restrict the common data endpoints with the host parameter and it works as expected but the endpoints does not disappear from the tenant API documentation (tenant_identifier.example.com/api/docs). Therefore, the host does not seems to be taken into account for the OpenAPI specification.
How to reproduce
I have the following service configuration to inject the hostname dynamically:
# config/services.yaml
parameters:
# Used for route host matching as %env(...)% syntax is not supported
# @see https://stackoverflow.com/questions/47165113/environment-variables-in-route-annotations
hostname: '%env(resolve:APP_HOST)%'
# .env
APP_HOST="example.com"
When I specify the host used for an ApiResource, for instance:
#[ApiResource(
// ...
host: '%hostname%',
// ...
)]
class FooBar
The endpoints are still available from the tenant API documentation (tenant_identifier.example.com).
Possible Solution
The server url should be taken into account as it's shown in the OpenAPI specification.
Additional Context
Ask if necessary
- 主要言語
- PHP
- スター
- 2.6k
- フォーク
- 989
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 100
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
api-platform/core のほかの issue
-
JSON:API: resource schemas (`*.jsonapi`) have `properties` but no `type: object`対応中かも @ousamabenyounes が 2 日前に担当しました。 オープン
難易度 2/5 1時間未満 初心者へのやさしさ 80/100
api-platform/core#8701 ·
メンテナーはふだん 1 日以内に返信
-
JSON:API: `JsonApiCollectionBaseSchemaNoPagination` declares `data` as `type: array` without `items`オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
api-platform/core#8699 ·
メンテナーはふだん 1 日以内に返信
-
[Json-Schema] Nested resources lost externalDoc and description data対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
api-platform/core#8721 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
api-platform/core#8704 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
api-platform/core#8703 ·
メンテナーはふだん 1 日以内に返信
api-platform/core の issue をすべて見る
似ている issue
-
domain/discovery
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
neos/flow-development-collection#3639 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
The PHP version check in prepare.php still allows PHP 7.2 and 7.3対応中かも @ekamran が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
WordPress/phpunit-test-runner#359 ·
メンテナーはふだん 2 日以内に返信
-
[ObjectMapper] Merge the objects that repeated `#[Map]` attributes map …対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンObjectMapper
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
symfony/symfony-docs#23390 ·
メンテナーはふだん 2 日以内に返信