Add explicit export_app route and schema prefix - #140
Merged
Conversation
Changepacksvespera@0.3.1 → 0.4.0 - Cargo.tomlMinor
vespera_macro@0.3.1 - crates/vespera_macro/Cargo.tomlMaybe you forgot to write the following files to the latest version vespera-bridge@0.3.1 → 0.4.0 - libs/vespera-bridge/build.gradle.ktsMinor
vespera-bridge-gradle-plugin@0.3.1 → 0.4.0 - libs/vespera-bridge-gradle-plugin/build.gradle.ktsMinor
|
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.
Summary
Rationale
Yeollin CMS loads independently authored plugin crates and merges their exported Vespera apps. Deriving public routes from Rust module layout makes moving a handler a public API change and leaves the intended plugin namespace implicit. It also cannot solve cross-crate component collisions: two plugins can each define a different Item, after which OpenAPI merging silently keeps only one schema and makes the other endpoint incorrect.
I chose prefix rather than base because the value is directly prepended to every exported route and route prefix is the clearest description at the call site. It also avoids suggesting that the value is an OpenAPI server or base URL.
Normalization is deterministic: a missing leading slash is added, trailing slashes are removed, and an empty string or root slash means no prefix. Whitespace, query or fragment syntax, empty path segments, and prefixes without an alphanumeric namespace are rejected with errors at the literal span.
For component names, the normalized path is Pascal-cased. A conventional leading /api segment is omitted when more specific segments follow, so /api/media-library yields the namespace MediaLibrary and Item becomes MediaLibraryItem. Explicit schema names such as SharedThing stay unnamespaced as deliberately global or shared DTOs. All component references are rewritten from the same rename map.
With no prefix, route paths, component names, and references remain unchanged.
Verification