API
General Structureβ
/filesβ
GETβ
Search the files with given query parameters.
To use negation, add ! as the first character.
Parameters for filtering:
tagnameowneraccesslocation: Folder to search in.option: For the above parameters, the filters can be combined withand/ortime: What timestamp to use (createdAt/updatedAt)start: Beginning of the time rangeend: End of the time range
sort: The datatype to sort onasc: Boolean for ascending / descending orderfuzziness: How strict the input must match for searching file names.(0β5)
Pagination Parameters:
page: Page number to returnlimit: Number of entries per page
POSTβ
Upload a file.
To create a directory, omit the file parameter.
/files/{file-id}β
GETβ
Get the properties of a file by ID.
PATCHβ
Update selected properties of the file.
POSTβ
Update the content of the file.
PUTβ
Completely update the file. Current properties and content will be replaced with the provided data.
DELETEβ
Delete the file.
/files/{file-id}/contentβ
GETβ
Retrieve the binary content of the file.
Our Openapi Generator Configurationβ
In <dependencies></dependencies>:
<!-- OpenApiDependencies -->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.36</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openapitools/jackson-databind-nullable -->
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.6</version>
</dependency>
In <plugins></plugins>:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/src/gen/java/main</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.14.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<inputSpec>${project.basedir}/src/main/resources/META-INF/fileService.openapi.yaml</inputSpec>
<output>${project.build.directory}/</output>
<modelPackage>${base.package}.model</modelPackage>
<apiPackage>${base.package}.api</apiPackage>
<invokerPackage>${base.package}.handler</invokerPackage>
<generatorName>spring</generatorName>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
<configPackage>${base.package}.configuration</configPackage>
<useSpringBoot3>true</useSpringBoot3>
<interfaceOnly>true</interfaceOnly>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
TODOβ
Coming changes to the API:
- Setting minimum and maximum values (Depends on the implementation β research is ongoing)
Definition:β
The API is defined in team-4-backend-abstract-file-service/src/main/resources/META-INF/fileService.openapi.yaml