OpenAPI (Swagger) documentation does not take into account the routes hostname
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu tại điểm vào của việc tạo tài liệu OpenAPI cho metadata của host ApiResource, sử dụng tài liệu API cho tenant và main-domain được mô tả trong báo cáo. So sánh các đặc tả được tạo cho cả hai host; hoàn thành khi các endpoint bị giới hạn theo host bị loại khỏi tài liệu của tenant và URL của server phản ánh host áp dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- PHP
- Star
- 2.6k
- Fork
- 988
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 105
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của api-platform/core
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
api-platform/core#8744 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
JSON:API: resource schemas (`*.jsonapi`) have `properties` but no `type: object`Có thể đã có người làm @ousamabenyounes đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 80/100
api-platform/core#8701 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Json-Schema] Nested resources lost externalDoc and description dataCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
api-platform/core#8721 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
JSON:API: 404/405 router errors are empty, and error objects have a non-spec `type` memberCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
api-platform/core#8704 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
JSON:API: request documents with no `data`, no `type` or a wrong `type` are accepted with 201Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
api-platform/core#8703 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của api-platform/core
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
lorisleiva/laravel-docker#166 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
kanboard/kanboard#5929 · 1 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Rebuild 6.2.3 images on PHP 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 (CVE-2026-109618, CVE-2026-109619)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
swoole/docker-swoole#65 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
PHP-CS-Fixer/PHP-CS-Fixer#9899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
backdrop-contrib/rules#257 ·