Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 165 additions & 164 deletions tile/pom.xml
Original file line number Diff line number Diff line change
@@ -1,175 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>au.org.aodn.ogcapi</groupId>
<artifactId>ogcapi-java</artifactId>
<version>0.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ogcapi-tile-java</artifactId>
<name>ogcapi-tile-java</name>
<description>REST API that implements OGC Tile API</description>
<properties>
<parent>
<groupId>au.org.aodn.ogcapi</groupId>
<artifactId>ogcapi-java</artifactId>
<version>0.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ogcapi-tile-java</artifactId>
<name>ogcapi-tile-java</name>
<description>REST API that implements OGC Tile API</description>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
</dependency>
<dependencies>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!--
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
-->
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>${swagger.codegen.version}</version>
<executions>
<execution>
<id>generate-ogcapi-tile</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<!-- https://github.com/swagger-api/swagger-codegen/issues/9720-->
<configuration>
<language>spring</language>
<modelPackage>${project.groupId}.tile.model</modelPackage>
<apiPackage>${project.groupId}.tile.api</apiPackage>
<invokerPackage>${project.groupId}.tile.invoker</invokerPackage>
<inputSpec>${project.basedir}/src/main/resources/schema/tile/ogcapi-tiles-1.yaml</inputSpec>
<verbose>true</verbose>
<output>${project.build.directory}/generated-sources</output>
<typeMappings>
<!--
The openapi specify an enum array for collection id, this makes generator created
enum class with fixed value which is wrong, we do not want this behavior and want a
pure string instead. We can override this by using the mapping below.
-->
<typeMapping>VectorTilesCollections=java.lang.String</typeMapping>
<typeMapping>AllCollections=java.lang.String</typeMapping>
<typeMapping>AllOftileSetItemCrs=java.lang.String</typeMapping>
<typeMapping>CoverageCollections=java.lang.String</typeMapping>
</typeMappings>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
<dateLibrary>java11-localdatetime</dateLibrary>
<jakarta>true</jakarta>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<!--
Problem with the generated class with name crash with Timestamp in jdk11
-->
<id>replace-line-in-files</id>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>${project.build.directory}/generated-sources/src/main/**/*.java</include>
</includes>
<replacements>
<replacement>
<token>import au\.org\.aodn\.ogcapi\.tile\.model\.TimeStamp;</token>
<value></value>
</replacement>
<replacement>
<!--
Multiple return type allow for this function, set it to ? to make it generic
ResponseEntity<String> -> ResponseEntity<?>
-->
<token>ResponseEntity&lt;String&gt; datasetVectorGetTile</token>
<value>ResponseEntity&lt;?&gt; datasetVectorGetTile</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<!--
Problem with the generated class with enum, replace it with string is much better type
-->
<id>replace-tile-set-itme</id>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>${project.build.directory}/generated-sources/src/main/**/TileSetItem.java</include>
</includes>
<replacements>
<replacement>
<token>AllOftileSetItemDataType</token>
<value>String</value>
</replacement>
<replacement>
<token>AllOftileSetItemCrs</token>
<value>String</value>
</replacement>
</replacements>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<build>
<plugins>
<!--
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
-->
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>${swagger.codegen.version}</version>
<executions>
<execution>
<id>generate-ogcapi-tile</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<!-- https://github.com/swagger-api/swagger-codegen/issues/9720-->
<configuration>
<language>spring</language>
<modelPackage>${project.groupId}.tile.model</modelPackage>
<apiPackage>${project.groupId}.tile.api</apiPackage>
<invokerPackage>${project.groupId}.tile.invoker</invokerPackage>
<inputSpec>${project.basedir}/src/main/resources/schema/tile/ogcapi-tiles-1.yaml</inputSpec>
<verbose>false</verbose>
<output>${project.build.directory}/generated-sources</output>
<typeMappings>
<!--
The openapi specify an enum array for collection id, this makes generator created
enum class with fixed value which is wrong, we do not want this behavior and want a
pure string instead. We can override this by using the mapping below.
-->
<typeMapping>VectorTilesCollections=java.lang.String</typeMapping>
<typeMapping>AllCollections=java.lang.String</typeMapping>
<typeMapping>AllOftileSetItemCrs=java.lang.String</typeMapping>
<typeMapping>CoverageCollections=java.lang.String</typeMapping>
</typeMappings>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
<dateLibrary>java11-localdatetime</dateLibrary>
<jakarta>true</jakarta>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<!--
Problem with the generated class with name crash with Timestamp in jdk11
-->
<id>replace-line-in-files</id>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>${project.build.directory}/generated-sources/src/main/**/*.java</include>
</includes>
<replacements>
<replacement>
<token>import au\.org\.aodn\.ogcapi\.tile\.model\.TimeStamp;</token>
<value></value>
</replacement>
<replacement>
<!--
Multiple return type allow for this function, set it to ? to make it generic
ResponseEntity<String> -> ResponseEntity<?>
-->
<token>ResponseEntity&lt;String&gt; datasetVectorGetTile</token>
<value>ResponseEntity&lt;?&gt; datasetVectorGetTile</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<!--
Problem with the generated class with enum, replace it with string is much better type
-->
<id>replace-tile-set-itme</id>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>${project.build.directory}/generated-sources/src/main/**/TileSetItem.java
</include>
</includes>
<replacements>
<replacement>
<token>AllOftileSetItemDataType</token>
<value>String</value>
</replacement>
<replacement>
<token>AllOftileSetItemCrs</token>
<value>String</value>
</replacement>
</replacements>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
3 changes: 3 additions & 0 deletions tile/src/main/resources/schema/tile/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
These stand-in API resources are intended to dynamically enumerate specific types of implementation/deployment-dependent available resources in responses to `/api/*`.

Alternatively, those resources could be directly enumerated in `schemas/dynamic/*`
20 changes: 10 additions & 10 deletions tile/src/main/resources/schema/tile/api/all-collections.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"type" : "string",
"enum" : [
"blueMarble",
"NaturalEarth:raster:HYP_HR_SR_OB_DR",
"NaturalEarth:cultural:ne_10m_admin_0_countries",
"NaturalEarth:physical:bathymetry",
"SRTM_ViewFinderPanorama",
"HRDEM-Ottawa",
"HRDEM-RedRiver"
]
"type" : "string",
"enum" : [
"blueMarble",
"NaturalEarth:raster:HYP_HR_SR_OB_DR",
"NaturalEarth:cultural:ne_10m_admin_0_countries",
"NaturalEarth:physical:bathymetry",
"SRTM_ViewFinderPanorama",
"HRDEM-Ottawa",
"HRDEM-RedRiver"
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"type" : "string",
"enum" : [
"SRTM_ViewFinderPanorama",
"HRDEM-Ottawa",
"HRDEM-RedRiver"
]
"type" : "string",
"enum" : [
"SRTM_ViewFinderPanorama",
"HRDEM-Ottawa",
"HRDEM-RedRiver"
]
}
8 changes: 4 additions & 4 deletions tile/src/main/resources/schema/tile/api/styles.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type" : "string",
"enum" : [
"default"
]
"type" : "string",
"enum" : [
"default"
]
}
Loading
Loading