Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path params don't work when using KubernetesServiceDiscoveryProvider #252

Closed
Arik-Shapiro opened this issue Jan 19, 2023 · 0 comments
Closed
Assignees

Comments

@Arik-Shapiro
Copy link

Describe the bug
A clear and concise description of what the bug is.
When using the KubernetesServiceDiscoveryProvider some endpoints just do not appear in swagger doc.

{
	"Routes": [
		{
			"DownstreamPathTemplate": "/api/audit/{everything}",
			"UpstreamPathTemplate": "/api/audit/{everything}",
			"ServiceName": "audit-service",
		},
		{
			"DownstreamPathTemplate": "/api/audit",
			"UpstreamPathTemplate": "/api/audit",
			"ServiceName": "audit-service",
			"SwaggerKey": "audit"
		}
	],
	"GlobalConfiguration": {
		"DownstreamScheme": "http",
		"ServiceDiscoveryProvider": {
			"Namespace": "default",
			"Type": "KubernetesServiceDiscoveryProvider"
		},
	},
	"SwaggerEndPoints": [
		{
			"Key": "audit",
			"Config": [
				{
					"Name": "Audit API",
					"Version": "v1",
					"Service": {
						"Name": "audit-service",
						"Path": "/swagger/v1/swagger.json"
					}
				}
			]
		}
	]
}

image

When using this one locally:

{
	"Routes": [
		{
			"DownstreamPathTemplate": "/api/audit/{everything}",
			"DownstreamHostAndPorts": [
				{
					"Host": "localhost",
					"Port": 5135
				}
			],
			"UpstreamPathTemplate": "/api/audit/{everything}",
			"SwaggerKey": "audit"
		},
		{
			"DownstreamPathTemplate": "/api/audit",
			"DownstreamScheme": "http",
			"DownstreamHostAndPorts": [
				{
					"Host": "localhost",
					"Port": 5135
				}
			],
			"UpstreamPathTemplate": "/api/audit",
			"SwaggerKey": "audit"
		}
	],
	"SwaggerEndPoints": [
		{
			"Key": "audit",
			"Config": [
				{
					"Version": "v1",
					"Name": "Audit API",
					"Url": "http://localhost:5135/swagger/v1/swagger.json"
				}
			]
		}
	]
}

Everything works as expected
image

Would appreciate some help, thanks!

@Arik-Shapiro Arik-Shapiro changed the title Wild card doesn't work when using KubernetesServiceDiscoveryProvider Path params don't work when using KubernetesServiceDiscoveryProvider Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants