Skip to content

Commit

Permalink
yaml files + no security generation in application
Browse files Browse the repository at this point in the history
  • Loading branch information
zalborzi committed Apr 4, 2024
1 parent b24a066 commit b32f98f
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
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"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.genomicdatainfrastructure</groupId>
<artifactId>gdi-userportal-dataset-discovery-service</artifactId>
Expand Down Expand Up @@ -81,6 +81,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
179 changes: 179 additions & 0 deletions src/main/openapi/ckan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
openapi: 3.0.3
info:
title: CKAN Package Search API
version: 1.0.0
description: API for searching CKAN packages using various criteria.
servers:
- url: http://example.com/api/3/action
paths:
/package_search:
get:
summary: Searches for packages based on criteria
operationId: packageSearch
parameters:
- name: q
in: query
description: Solr search query
required: false
schema:
type: string
default: "*:*"
- name: fq
in: query
description: Filter query to apply
required: false
schema:
type: string
- name: fq_list
in: query
description: Additional filter queries
required: false
style: form
explode: true
schema:
type: array
items:
type: string
- name: sort
in: query
description: Sorting of search results
required: false
schema:
type: string
default: "score desc, metadata_modified desc"
- name: rows
in: query
description: Max number of rows to return
required: false
schema:
type: integer
default: 10
maximum: 1000
- name: start
in: query
description: Offset in the complete result set
required: false
schema:
type: integer
- name: facet
in: query
description: Whether to enable faceted results
required: false
schema:
type: string
default: "true"
responses:
'200':
description: A list of packages matching the search criteria
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The number of results found
results:
type: array
items:
$ref: '#/components/schemas/Dataset'
search_facets:
type: object
additionalProperties: true
description: Aggregated information about facet counts
components:
schemas:
Dataset:
type: object
properties:
id:
type: string
title:
type: string
source:
type: string
version:
type: string
author:
type: string
authorEmail:
type: string
maintainer:
type: string
maintainerEmail:
type: string
contactURI:
type: string
contactName:
type: string
contactEmail:
type: string
publisher:
type: string
publisherName:
type: string
publisherEmail:
type: string
publisherURL:
type: string
publisherType:
type: string
spatialURI:
type: string
temporalStartDate:
type: string
temporalEndDate:
type: string
theme:
type: string
versionNotes:
type: string
landingPage:
type: string
spatialResolutionInMeters:
type: string
temporalResolution:
type: string
qualifiedRelation:
type: string
accessRights:
type: string
frequency:
type: string
conformsTo:
type: string
creator:
type: string
isReferencedBy:
type: string
isVersionOf:
type: string
identifier:
type: string
issued:
type: string
language:
type: string
modificationDate:
type: string
provenance:
type: string
relation:
type: string
sample:
type: string
type:
type: string
hasVersion:
type: string
documentation:
type: string
qualifiedAttribution:
type: string
wasGeneratedBy:
type: string
alternateIdentifier:
type: string
required:
- id
- title
192 changes: 192 additions & 0 deletions src/main/openapi/discovery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
openapi: 3.0.3
info:
title: CKAN Package Search API
version: 1.0.0
description: API for searching CKAN packages using various criteria.
servers:
- url: http://example.com/api/3/action
paths:
/package_search:
get:
summary: Searches for packages based on criteria
operationId: packageSearch
parameters:
- name: q
in: query
description: Solr search query
required: false
schema:
type: string
default: "*:*"
- name: fq
in: query
description: Filter query to apply
required: false
schema:
type: string
- name: fq_list
in: query
description: Additional filter queries
required: false
style: form
explode: true
schema:
type: array
items:
type: string
- name: sort
in: query
description: Sorting of search results
required: false
schema:
type: string
default: "score desc, metadata_modified desc"
- name: rows
in: query
description: Max number of rows to return
required: false
schema:
type: integer
default: 10
maximum: 1000
- name: start
in: query
description: Offset in the complete result set
required: false
schema:
type: integer
- name: facet
in: query
description: Whether to enable faceted results
required: false
schema:
type: string
default: "true"
responses:
'200':
description: A list of packages matching the search criteria
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The number of results found
results:
type: array
items:
$ref: '#/components/schemas/Dataset'
search_facets:
type: object
additionalProperties: true
description: Aggregated information about facet counts
security:
- discovery_auth:
- read:datasets
components:
securitySchemes:
discovery_auth:
type: oauth2
description: This API uses OAuth 2 with the implicit grant flow.
flows:
authorizationCode:
tokenUrl: https://api.example.com/oauth2/token
authorizationUrl: https://api.example.com/oauth2/authorize
scopes:
read:datasets: read datasets
schemas:
Dataset:
type: object
properties:
id:
type: string
title:
type: string
source:
type: string
version:
type: string
author:
type: string
authorEmail:
type: string
maintainer:
type: string
maintainerEmail:
type: string
contactURI:
type: string
contactName:
type: string
contactEmail:
type: string
publisher:
type: string
publisherName:
type: string
publisherEmail:
type: string
publisherURL:
type: string
publisherType:
type: string
spatialURI:
type: string
temporalStartDate:
type: string
temporalEndDate:
type: string
theme:
type: string
versionNotes:
type: string
landingPage:
type: string
spatialResolutionInMeters:
type: string
temporalResolution:
type: string
qualifiedRelation:
type: string
accessRights:
type: string
frequency:
type: string
conformsTo:
type: string
creator:
type: string
isReferencedBy:
type: string
isVersionOf:
type: string
identifier:
type: string
issued:
type: string
language:
type: string
modificationDate:
type: string
provenance:
type: string
relation:
type: string
sample:
type: string
type:
type: string
hasVersion:
type: string
documentation:
type: string
qualifiedAttribution:
type: string
wasGeneratedBy:
type: string
alternateIdentifier:
type: string
required:
- id
- title
Loading

0 comments on commit b32f98f

Please sign in to comment.