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

Use path segments parameter for Url.crossOrigin #72

Closed
wolfadex opened this issue Apr 15, 2024 · 1 comment
Closed

Use path segments parameter for Url.crossOrigin #72

wolfadex opened this issue Apr 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@wolfadex
Copy link
Owner

It'd be great if the urls could be generated using Url.crossOrigin's path segments parameter. In my case, an openapi endpoint /example/{x} results in this Elm code

            Url.Builder.crossOrigin
                (String.replace
                    "{x}"
                    config.params.x
                    "http://example.com/example/{x}"
                )
                []
                ...

which then results in an url with a trailing slash http://example.com/example/x/. However, this then does not match the endpoint's url in the openapi spec which is without trailing slash.

Would it be possible to have the Elm code being generated like this:

            Url.Builder.crossOrigin
                "http://example.com"
                [ "example"
                , config.params.x
                ]
                ...

Then the resulting url would be without trailing slash and hence matching the openapi spec.

Moved from wolfadex/elm-open-api#6

cc @myrho

@wolfadex
Copy link
Owner Author

Resolved by #75 and will be released with v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant