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

UseStaticFiles is supposed to come before UseRouting #425

Closed
wants to merge 2 commits into from

Conversation

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 30, 2019

If you want static files to also support CORS, then they have to appear after UseRouting. I'm not sure why someone would want CORS for static files, I was thinking someone could add a JSON static file and CORS would be useful for that.

What are your thoughts?

@VictorioBerra

This comment has been minimized.

Copy link
Collaborator Author

VictorioBerra commented Oct 30, 2019

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 30, 2019

The CORS docs said to do it this way. I'm actually going to merge your change though, I'm not sure CORS for static files is required.

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 30, 2019

Swashbuckle has the ability to use precompiled JSON for the open api definition. Been meaning to use that instead of the current runtime generated JSON. I'll leave it as is for now.

I will take your change to fix the Swagger server setting though.

@RehanSaeed RehanSaeed closed this Oct 30, 2019
@VictorioBerra

This comment has been minimized.

Copy link
Collaborator Author

VictorioBerra commented Oct 30, 2019

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 30, 2019

Not tried it yet, going to do some testing after upgrading Swashbuckle code properly.

I can't seem to find it in their docs anymore. I think it was a preview/beta last time I checked. I'll see if I can dig it out.

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 30, 2019

The Swashbuckle.AspNetCore.Cli package provides this functionality.

@VictorioBerra

This comment has been minimized.

Copy link
Collaborator Author

VictorioBerra commented Oct 30, 2019

So what's the goal here? Generate it at build time and then serve it? Just performance? What if you need dynamically built swagger doc like when you change the host based on the request for hosting behind load balancers etc.

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 31, 2019

Performance mainly. In that scenario, you'd stick to using runtime generation. I'm considering adding it by default. Thoughts?

@VictorioBerra

This comment has been minimized.

Copy link
Collaborator Author

VictorioBerra commented Oct 31, 2019

@VictorioBerra

This comment has been minimized.

Copy link
Collaborator Author

VictorioBerra commented Oct 31, 2019

@RehanSaeed Why not move ApiVersionOperationFilter and CorrelationIdOpFilt to Boxed.Framework?

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 31, 2019

Yes, I'll consider that. The API template is almost done. All tests pass. Remaining:

  • Need to fix all schema filters. I think you can now add comments like <example>foo</example> instead of using schema filters.
  • I was going to look into Dotnet-Boxed/Framework#27.
  • Going to watch and read some stuff about Open API 3.
@VictorioBerra

This comment has been minimized.

Copy link
Collaborator Author

VictorioBerra commented Oct 31, 2019

Need to fix all schema filters. I think you can now add comments like foo instead of using schema filters.

That sounds interesting, got a link to any docs? Id like to look at it

@RehanSaeed

This comment has been minimized.

Copy link
Member

RehanSaeed commented Oct 31, 2019

Check the latest commit. The docs are on the swashbuckle home page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.