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

[DRAFT] OpenAPI Spec creator #69

Merged
merged 25 commits into from
Apr 10, 2024
Merged

[DRAFT] OpenAPI Spec creator #69

merged 25 commits into from
Apr 10, 2024

Conversation

ThorodanBrom
Copy link
Collaborator

No description provided.

@jenkins-datakaveri
Copy link

Build finished.

6 similar comments
@jenkins-datakaveri
Copy link

Build finished.

@jenkins-datakaveri
Copy link

Build finished.

@jenkins-datakaveri
Copy link

Build finished.

@jenkins-datakaveri
Copy link

Build finished.

@jenkins-datakaveri
Copy link

Build finished.

@jenkins-datakaveri
Copy link

Build finished.

- `EntityRouterBuilder` abstract class has the final method `getRouter` that creates
the router and uses methods that child classes must implement
- `StacRouterBuilder` and `OgcRouterBuilder` extend `EntityRouterBuilder`
and create STAC and OGC specific routers
- `DxMeteringRouter` extends `EntityRouterBuilder` but only provides static routes for
DX metering APIs
…nterface (SPI) and added GisEntityInterface class

- Added AutoService dependency to pom, along with entry in annotationProcessor block
	- Latter is required to generate files in META-INF that are required by SPI for all annotated classes
- Added `GisEntityInterface` to model any GIS entity that requires dynamic route generation
	- Implementers of this class will be accessed by SPI
…chema

- Once the OpenAPI Specs are generated/regenerated, we use JSON Schema to validate
- Remove routers and router builder code
	- This will be handled by another component
- Added method `resetRouter`
	- This method will be called by the other component to add/refresh routes
	served by the ApiServerVerticle
- Update server start-up by waiting for router to get initialized
	- Wait for router to get at least one path
	- In case router is not initialized, throw RuntimeException
- Update all API methods to be public
	- So that routers can be built using the ApiServerVerticle object
- Add method for specifically serving landing page
- For OGC Features, update getting of collection ID from routing context
by splitting path instead of path param
	- Since every collection has a specific path in the OpenAPI spec,
	cannot use path param anymore
- Update AuthHandler to get collection ID by splitting instead of path param
@jenkins-datakaveri
Copy link

Build finished.

1 similar comment
@jenkins-datakaveri
Copy link

Build finished.

@ThorodanBrom
Copy link
Collaborator Author

retest this please

@jenkins-datakaveri
Copy link

Build finished.

@ThorodanBrom
Copy link
Collaborator Author

retest this please

@jenkins-datakaveri
Copy link

Build finished.

The main class here is `OgcFeaturesEntity` that implements `GisEntityInterface`
and is accessible with SPI, so can be used to generate spec and supply routes as well.
The rest of the classes are helpers.

CollectionMetadata
------------------
- Class that contains data about an OGC Feature collection and contains
methods for OpenAPI spec building

PostgisGeomTypes
----------------
- Enum containing all geometry types supported in PostGIS

OasTypes
--------
- Enum to hold all valid types in OpenAPI and support mapping of
Postgres/PostGIS types to OpenAPI types
- Added database config since Postgres LISTEN/NOTIFY channel needs to be created in RouterManager
- Added geometry max limit config for configuring the maximum number of feature sent in the /collections/items
endpoint depending on the geometry of the collection
- Before deploying instances of the ApiServerVerticle, initialize one instance of RouterManager
and register all instances of ApiServerVerticle with RouterManager
- Remove paths that are getting automatically generated
- Was removed from ApiServerVerticle
- No dynamic route creation for now, only static routes
- No dynamic route creation for now, only static routes
- Remove all CompositeFuture.all, change to Future.all since former is deprecated
- Update some logs levels
…greSQL integer types to OpenAPI integer type
- Replaced all hard-coded URLs in OGC, STAC specs with `${HOSTNAME}` then
 replacing the placeholder with the configured `hostName` in `commonConfig` on first router build
- Added production and development URLs to metering config
	- Did not do placeholder replacement as it is a little more difficult
- Removed sed find-replace of Jenkins server URL in Dockerfile, since it should be taken care of by this change
… auth is disabled (`disable.auth` property) for OGC and STAC specs.

Also added token required header for dynamic OGC routes and assets API

- In OGC,STAC specs, made the token header a $ref and updated paths accordingly
- Added token header for assets API
- In RouterManager, check for `disable.auth` property and set `required` as false for the token header in OGC,STAC specs
- In CollectionMetadata, set `/collections/{collectionId}/items` and `/collections/{collectionId}/items/{featureId}` to have token header
….resetRouter

- STAC APIs were not working when it was in the former
…e queries

- ORDER BY added for all feature queries since it seems that when using the PostGIS
functions, we cannot guarantee that same result set is returned for a given limit and offset
- Using ORDER BY forces order, therefore same result set always returned
- As of this commit, FeatureQueryBuilder subtracts 1 from given offset always
…r OGC features

- OGC features compliance spec was failing because it was conditionally there
@jenkins-datakaveri
Copy link

Build finished.

@ThorodanBrom ThorodanBrom merged commit 558dfd7 into datakaveri:main Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants