Skip to content

Commit

Permalink
Open API doc added under docs/api directory
Browse files Browse the repository at this point in the history
  • Loading branch information
amoldashwant committed Jul 17, 2024
1 parent 8963bd2 commit dd43de8
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Added
- Current OpenAPI file added under /docs/api directory.
### Fixed
- Dependabot reported security issues fixed.
- Pom changes for dependency check
Expand Down
158 changes: 158 additions & 0 deletions docs/api/openAPI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#################################################################################
# Copyright (c) 2024 T-Systems International GmbH
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

openapi: 3.0.0
info:
version: Release3
title: SD-Factory API
description: API for creating and storing the Verifiable Credentials
paths:
/api/rel3/selfdescription:
post:
summary: Creates a Verifiable Credential and returns it
operationId: selfdescriptionPost
requestBody:
required: true
description: parameters to generate VC
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/LegalParticipantSchema'
- $ref: '#/components/schemas/ServiceOfferingSchema'
discriminator:
propertyName: type
mapping:
LegalParticipant: '#/components/schemas/LegalParticipantSchema'
ServiceOffering: '#/components/schemas/ServiceOfferingSchema'
examples:
LegalParticipant:
description: payload to create LegalParticipant
value:
externalId: ID01234-123-4321
type: LegalParticipant
holder: BPNL000000000000
issuer: CAXSDUMMYCATENAZZ
registrationNumber:
- type: taxID
value: o12345678
headquarterAddress.country: DE
legalAddress.country: DE
bpn: BPNL000000000000
ServiceOffering:
description: payload to create ServiceOffering
value:
externalId: ID01234-123-4321
type: ServiceOffering
holder: BPNL000000000000
issuer: CAXSDUMMYCATENAZZ
providedBy: https://participant.url
aggregationOf: https://aggr1.url, https://aggr2.url
termsAndConditions: https://raw.githubusercontent.com/eclipse-tractusx/sd-factory/main/LICENSE
policies: policy1, policy2
responses:
'202':
description: request has been accepted for processing
components:
securitySchemes:
bearerAuth: # arbitrary name for the security scheme
type: http
scheme: bearer
bearerFormat: JWT # optional, arbitrary value for documentation purposes
schemas:
SelfDescriptionSchema:
type: object
properties:
type:
type: string
holder:
type: string
issuer:
type: string
externalId:
type: string
required:
- type
- holder
- issuer
- externalId
RegistrationNumberSchema:
type: object
description: Registration Number element
properties:
type:
type: string
description: the mean to request data retrieval
enum:
- taxID
- local
- vatID
- EUID
- EORI
- leiCode
value:
type: string
description: Registration Number value
minLength: 1
maxLength: 128
LegalParticipantSchema:
type: object
allOf:
- $ref: '#/components/schemas/SelfDescriptionSchema'
- type: object
properties:
registrationNumber:
type: array
uniqueItems: true
minItems: 1
maxItems: 512
description: A list of registration numbers
items:
$ref: '#/components/schemas/RegistrationNumberSchema'
headquarterAddress.country:
type: string
legalAddress.country:
type: string
bpn:
type: string
required:
- registrationNumber
- headquarterAddress.country
- legalAddress.country
- bpn
ServiceOfferingSchema:
type: object
allOf:
- $ref: '#/components/schemas/SelfDescriptionSchema'
- type: object
properties:
providedBy:
type: string
format: uri
aggregationOf:
type: string
termsAndConditions:
type: string
policies:
type: string
required:
- providedBy
security:
- bearerAuth: []

0 comments on commit dd43de8

Please sign in to comment.