Skip to content

Commit

Permalink
[core] Add basic implementation to support REST Catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-024 committed Nov 20, 2024
1 parent d70fe35 commit 289fbb9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions paimon-open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ info:
title: RESTCatalog API
description: This API exposes endpoints to RESTCatalog.
license:
name: MIT License
url: https://choosealicense.com/licenses/mit/
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: '1.0'
servers:
- url: http://localhost:8080
Expand All @@ -34,6 +34,12 @@ paths:
- config
summary: Get Config
operationId: getConfig
parameters:
- name: prefix
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -59,7 +60,8 @@ public class RESTCatalogController {
content = {@Content(schema = @Schema())})
})
@PostMapping("/config")
public ResponseEntity<ConfigResponse> getConfig(@RequestBody ConfigRequest request) {
public ResponseEntity<ConfigResponse> getConfig(
@PathVariable String prefix, @RequestBody ConfigRequest request) {
try {
Map<String, String> defaults = new HashMap<>();
ConfigResponse response = new ConfigResponse(defaults);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public OpenAPI myOpenAPI() {
server.setDescription("Server URL in Development environment");

License mitLicense =
new License().name("MIT License").url("https://choosealicense.com/licenses/mit/");
new License()
.name("Apache 2.0")
.url("https://www.apache.org/licenses/LICENSE-2.0.html");

Info info =
new Info()
Expand Down

0 comments on commit 289fbb9

Please sign in to comment.