Repository navigation
Add ApiExtension ServiceLoader extension point - #236
Merged
Merged
Conversation
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.
Nothing in the repository implements it yet beyond a test fixture. OGC API - Tiles (later PR) is the first planned consumer. The Features resources are not moved behind it.
Extension discovery
java.util.ServiceLoader, asOutputFormatFactorySpiApiExtensionFactorycreate(ApiExtensionContext)runs once at startup. Returningnullmeans nothing is configured for it and it is skipped with a log line. Throwing fails startup, so a broken configuration cannot serve a partial APIApiExtensionContextOutputFormatFactorySpi.create(Map))ApiExtensionfvalues and injectablesgetInjectables()returns the module's own config objects for DI, declared as plain types so core has no DI frameworkgetCollectionIdsis separate fromgetOperationsbecause the OpenAPI generator asks a freshly constructed operation that has no injected stategetFormatMediaTypesmakes an extension'sfvalues work likef=json. Core's own ids are resolved first and winCloseable, closed by the listener with the contextCollectionInfosetItemType(new) lets an extension publish a collection that is not a feature collection. The extension builds the wholeCollectionInfo, since only it knows the links, extent and item typeOpenAPISchemaContributor/OpenAPISchemaContributorsServiceLoaderSPI, letting an extension describe its own response models without the generator naming them. First non-null answer winsThe 400 for an invalid
f=now lists every accepted value: metadata formats, configured output formats and extension formats. It previously listed only the metadata formats, so clients matching on the old message text will see a different list.With no extension on the classpath nothing else changes.