question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OpenAPI not adding backslash to URLs

See original GitHub issue

Using the default host.json configuration below. Functions all work great through postman, but when trying to execute through OpenAPI site, it is not adding a backslash to the URL after the domain/port:

Request URL http://localhost:7071api/v1/todo?status=active

TypeError: Failed to execute ‘fetch’ on ‘Window’: Failed to parse URL from http://localhost:7071api/v1/todo?status=active

host.json:

{ "version": "2.0", "extensions": { "http": { "routePrefix": "" } } }

Function: .Functions(functions => functions .HttpRoute("/api/v1/HelloWorld", route => route .HttpFunction<HelloWorldCommand>() ) .HttpRoute("/api/v1/todo", route => route .HttpFunction<GetTodoQuery>(HttpMethod.Get) .HttpFunction<GetTodoByIdQuery>("/{id}", HttpMethod.Get) .HttpFunction<CreateTodoCommand>(HttpMethod.Post) .HttpFunction<MarkTodoAsCompleteCommand>("/complete", HttpMethod.Put) .OpenApiDescription("this is a test") ) );

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JamesRandallcommented, May 9, 2019

This should all be resolved in v2.1.1 that is indexing in NuGet now.

Thanks for raising.

0reactions
vip32commented, May 13, 2019

yes @JamesRandall, it is fixed now. many thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for path parameters which can contain slashes #892
According to OAI/OpenAPI-Specification#892 slashes aren't (yet?) supported in path templating parts, so change the Path class to adhere to that ...
Read more >
When forward slashes need to be escaped in OpenAPI 3?
In this example the first two forward slashes are not escaped? ... And these paths are not escaped? In which case all (or...
Read more >
Trailing slashes on URLs: Contentious or settled?
If there's no trailing slash, try to load the file with the equivalent extension to the Accept content-type header.
Read more >
API Host and Base Path
basePath is the URL prefix for all API paths, relative to the host root. It must start with a leading slash / ....
Read more >
Passing a parameter with slashes to the REST call
To answer the original question: I don't see a need to add URL parameters to the URL map. They would only add value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found