Repository navigation
Swagger UI that renders well: structured OpenAPI + UseEzODataSwaggerUI() (1.0.7) - #7
Merged
Merged
Conversation
- One tag per table (with columns, key, related tables), and every operation
tagged, so Swagger UI groups by table instead of one 'default' list.
- Summaries read correctly ('Create a row in customers', not 'Create a
customers'); operationIds (customers_list, ...).
- By-key paths declare their path parameters: 'Try it out' now has an {id}
input instead of sending a literal {id}.
- REST list responses documented under 'resource' (what REST returns);
REST create documented as 201.
- info.description: a short guide to the query options, with examples built
from the service's real columns; per-operation hints incl. $expand targets.
- GeneratorVersion 1.1 (refreshes ETag-cached documents).
…line Serves Swagger UI (default /swagger) listing every service declared with AddService on every API mapped with MapEzOData/MapEzODataRest, discovered at request time. Try it out on by default, table filter, request timings, deep links, schemas section hidden, and ez-odata styling (versioned stylesheet, responsive). Uses Swashbuckle.AspNetCore.SwaggerUI's embedded assets, so it works offline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In Swagger UI the generated documents rendered poorly:
{id}input, so "Try it out" sent a literal{id}OpenAPI documents (
EzOdata.Docs)Table · 5 columns · key: id · related: orders. Every operation is tagged.Query customers,Create a row in customers,Get a row from customers by key, and so on. Operations also get operationIds (customers_list, …).resource(what REST returns), and REST create as 201.info.description: a short query guide whose examples come from the service's real columns. Per-operation hints include the$expandtargets.GeneratorVersion1.1, which refreshes ETag-cached documents.app.UseEzODataSwaggerUI()(EzOdata.AspNetCore)/swaggerlisting every declared service on every mapped API, discovered at request time, so the order of calls doesn't matter.Swashbuckle.AspNetCore.SwaggerUI's embedded assets, so it works offline.Verified in a real browser
Tested on a two-database sample (shop and warehouse, OData and REST):
GET /products(2)→ 200Tests
OpenApiDocsTests.Openapi_is_structured_for_swagger_uiandRest_openapi_documents_the_resource_envelope: real PostgreSQL.EmbeddedHostTests.Swagger_ui_lists_every_service_on_every_mapped_api.