Skip to content

feat: add NDVI process endpoint and OpenAPI documentation#4

Open
ChristianBeilschmidt wants to merge 40 commits intomainfrom
openapi
Open

feat: add NDVI process endpoint and OpenAPI documentation#4
ChristianBeilschmidt wants to merge 40 commits intomainfrom
openapi

Conversation

@ChristianBeilschmidt
Copy link
Member

  • Implemented the NDVI process execution endpoint in path_info.rs.
  • Added OpenAPI specifications for the NDVI process inputs and outputs.
  • Created a justfile for managing API client generation and backend tasks.
  • Generated initial OpenAPI specification and saved it to openapi.json.

Added a proprietary license to the repository outlining permitted and prohibited actions regarding the software.
- Removed geoengine-datatypes and geoengine-operators dependencies from Cargo.toml.
- Updated NDVI process in ndvi.rs to use new VectorOperator and RasterOperator structures.
- Refactored source functions to return RasterOperator directly instead of boxed trait objects.
- Modified to_api_workflow function to accept VectorOperator and adjusted workflow type handling.
- Updated unit tests to reflect changes in operator structure and ensure correct serialization.
@ChristianBeilschmidt ChristianBeilschmidt force-pushed the openapi branch 3 times, most recently from 824c232 to 17254a8 Compare February 10, 2026 12:31
@ChristianBeilschmidt ChristianBeilschmidt marked this pull request as ready for review February 10, 2026 12:33
@ChristianBeilschmidt ChristianBeilschmidt force-pushed the openapi branch 10 times, most recently from be5b2c4 to 438e3d6 Compare February 10, 2026 13:58
@ChristianBeilschmidt
Copy link
Member Author

supersedes #3


###

POST http://localhost:4040/processes/ndvi/execution
Copy link

@michaelmattig michaelmattig Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I delete the ndvi dataset on the server I still get a weird error:

{
"type": "500",
"detail": "error in response: status code 400 Bad Request"
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,22 @@
# Copilot Instructions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also need a AGENTS.md in the root of the project?

like homeassistant does https://github.com/home-assistant/core/blob/dev/AGENTS.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, for Copilot, this is the recommended way. This gives a general instruction for everything and scoped instructions for parts. This works in VSCode like a charm.

let mut openapi_spec = None;
for _ in 0..10 {
info!("Trying to fetch OpenAPI spec from server…");
if let Ok(spec) = server.try_fetch_openapi_spec().await {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why load the openapi spec from our own server instead of just generating it? is it because of the ogcapi crate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was not possible before, but now it is:
fb76d81fb76d81

#[allow(unused, reason = "Placeholder for spec only")]
#[utoipa::path(
post,
path = "/processes/ndvi/execution",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it "in the spirit of" ogcapi processes that the jobs are hardcoded as paths in the openapi schema? would be a bit like offering individual workflows in the openapi spec of Geo Engine as paths

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under "15. Additional API Building Blocks", it says

This standard uses the OpenAPI specification to define the JSON schemas and OpenAPI MAY also be used to describe the concrete API (see Clause 7.3). […] To cope with this and thus make the implementation of clients / servers easier for those that are not familiar with OGC (API) standards, additional alternatives to the process description and the paths to processes and jobs are permitted.

Moreover, this allows us to statically type it in our UI.

}

// const OPEN_API_PATH: &str = "api";
const OPEN_API_PATH: &str = "api_v3.1";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does the openapi version matter? would we ever host multiple versions of openapi schema simultaneously?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current schema is version 3.1, which extends JSON-schema.

However, the current OGC cite validadation software fails on OpenAPI 3.1, but requires the old one. Thus, ogcapi offers under /api the one that gets eaten by CITE and under /api_v3.1 the better one.

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