Skip to content

Commit

Permalink
Update component.yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasithalalanga committed Nov 20, 2024
1 parent 769ae0a commit 350a6a0
Show file tree
Hide file tree
Showing 89 changed files with 861 additions and 940 deletions.
4 changes: 2 additions & 2 deletions .azure/scripts/validate_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def validate_metadata_and_thumbnails():
if build_result.returncode != 0:
raise RuntimeError(f"Error building image {image_url}: {build_result.stderr.decode('utf-8')}")

# Check if openapi.yaml and endpoints.yaml exist if the component type is a service
# Check if openapi.yaml and component.yaml exist if the component type is a service
if component_type == SAMPLE_COMPONENT_TYPE_SERVICE:
endpoints_path = os.path.join(REPO_BASE_DIR, component_path.lstrip('/'), '.choreo/endpoints.yaml')
endpoints_path = os.path.join(REPO_BASE_DIR, component_path.lstrip('/'), '.choreo/component.yaml')
if not os.path.exists(endpoints_path):
raise FileNotFoundError(f"Error: endpoints.yaml not found in {component_path.lstrip('/')}")
# openapi.yaml is required if service type is REST
Expand Down
17 changes: 16 additions & 1 deletion content-based-router-news-mi/.choreo/component.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com/) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://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.

# +required The configuration file schema version
schemaVersion: 1.0

Expand All @@ -19,7 +35,6 @@ endpoints:
# Allowed values: REST, GraphQL, GRPC, TCP, UDP.
type: REST
# +optional Network level visibilities of the endpoint.
# Takes priority over networkVisibility if defined.
# Accepted values: Project|Organization|Public(Default).
networkVisibilities:
- Public
Expand Down
8 changes: 0 additions & 8 deletions content-based-router-news-mi/.choreo/endpoints.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com/) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://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.

# +required The configuration file schema version
schemaVersion: 1.0

Expand All @@ -19,7 +35,11 @@ endpoints:
# Allowed values: REST, GraphQL, GRPC, TCP, UDP.
type: REST
# +optional Network level visibilities of the endpoint.
# Takes priority over networkVisibility if defined.
# Accepted values: Project|Organization|Public(Default).
networkVisibilities:
- Organization
# +optional The path to the schema definition file.
# Defaults to wildcard route if not specified.
# This is only applicable to REST endpoint types.
# The path should be relative to the docker context.
schemaFilePath: openapi.yaml

This file was deleted.

258 changes: 258 additions & 0 deletions customer-reward-management/loyalty-management/data-store/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
openapi: 3.0.1
info:
title: /
version: 0.1.0
servers:
- url: "{server}:{port}/"
variables:
server:
default: http://localhost
port:
default: "9090"
paths:
/reward-confirmation:
get:
operationId: getRewardConfirmation
parameters:
- name: userId
in: query
required: true
schema:
type: string
- name: rewardId
in: query
required: true
schema:
type: string
responses:
"200":
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/RewardConfirmation'
"500":
description: InternalServerError
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
post:
operationId: postRewardConfirmation
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RewardConfirmation'
required: true
responses:
"201":
description: Created
content:
text/plain:
schema:
type: string
"500":
description: InternalServerError
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
/reward-confirmations:
get:
operationId: getRewardConfirmations
parameters:
- name: userId
in: query
required: true
schema:
type: string
responses:
"200":
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RewardConfirmation'
"500":
description: InternalServerError
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
/users:
get:
operationId: getUsers
responses:
"200":
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
"500":
description: InternalServerError
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
/reward-offers:
get:
operationId: getRewardOffers
responses:
"200":
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RewardOffer'
"500":
description: InternalServerError
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
/user-rewards:
get:
operationId: getUserRewards
responses:
"200":
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UserReward'
"500":
description: InternalServerError
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorPayload'
components:
schemas:
ErrorPayload:
required:
- message
- method
- path
- reason
- status
- timestamp
type: object
properties:
timestamp:
type: string
status:
type: integer
format: int64
reason:
type: string
message:
type: string
path:
type: string
method:
type: string
RewardConfirmation:
required:
- rewardConfirmationNumber
- rewardId
- userId
type: object
properties:
userId:
type: string
rewardId:
type: string
rewardConfirmationNumber:
type: string
additionalProperties: false
description: Represents a reward confirmation.
RewardOffer:
required:
- description
- id
- logoUrl
- name
- totalPoints
- value
type: object
properties:
id:
type: string
name:
type: string
value:
type: number
format: float
totalPoints:
type: integer
format: int64
description:
type: string
logoUrl:
type: string
additionalProperties: false
description: Represents a reward offer.
User:
required:
- email
- firstName
- lastName
- userId
type: object
properties:
userId:
type: string
firstName:
type: string
lastName:
type: string
email:
type: string
additionalProperties: false
description: Represents a user.
UserReward:
required:
- acceptedTnC
- selectedRewardDealId
- timestamp
- userId
type: object
properties:
userId:
type: string
selectedRewardDealId:
type: string
timestamp:
type: string
acceptedTnC:
type: boolean
additionalProperties: false
description: Represents a user reward.
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com/) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://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.

# +required The configuration file schema version
schemaVersion: 1.0

Expand All @@ -19,7 +35,6 @@ endpoints:
# Allowed values: REST, GraphQL, GRPC, TCP, UDP.
type: REST
# +optional Network level visibilities of the endpoint.
# Takes priority over networkVisibility if defined.
# Accepted values: Project|Organization|Public(Default).
networkVisibilities:
- Organization
Expand Down
Loading

0 comments on commit 350a6a0

Please sign in to comment.