Skip to content

Commit

Permalink
feat(backstage): backstage layer types
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurzydym committed May 14, 2024
1 parent f471e25 commit 222e182
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 23 deletions.
13 changes: 9 additions & 4 deletions backstage/examples/address-validation-service/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
"kind": "Component",
"metadata": {
"name": "address-validation-service",
"links": [{
"url": "http://localhost:30080/webjars/swagger-ui/index.html",
"title": "Address Validation Service"
}],
"annotations": {
"backstage.io/managed-by-origin-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml",
"backstage.io/managed-by-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml"
}
},
"spec": {
"type": "service",
"type": "system-api",
"description": "This is the description of the address-validation service.",
"lifecycle": "experimental",
"owner": "guests",
"owner": "ok-user-team",
"providesApis": [
"address-validation-service-api"
],
Expand All @@ -32,8 +37,8 @@
"spec": {
"type": "openapi",
"lifecycle": "experimental",
"owner": "guests",
"definition": "{\"components\":{\"schemas\":{\"Address\":{\"properties\":{\"city\":{\"$ref\":\"#/components/schemas/City\",\"type\":\"object\"},\"street\":{\"$ref\":\"#/components/schemas/Street\",\"type\":\"object\"}},\"type\":\"object\"},\"City\":{\"properties\":{\"zipCode\":{\"type\":\"string\"},\"cityName\":{\"type\":\"string\"}},\"type\":\"object\"},\"Street\":{\"properties\":{\"number\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.1\",\"paths\":{\"/valid-addresses\":{\"post\":{\"operationId\":\"validateAddress\",\"parameters\":[],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"}}}}}}"
"owner": "ok-user-team",
"definition": "{\"servers\":[{\"url\":\"http://localhost:30080\"}],\"components\":{\"schemas\":{\"Address\":{\"properties\":{\"city\":{\"$ref\":\"#/components/schemas/City\",\"type\":\"object\"},\"street\":{\"$ref\":\"#/components/schemas/Street\",\"type\":\"object\"}},\"type\":\"object\"},\"City\":{\"properties\":{\"zipCode\":{\"type\":\"string\"},\"cityName\":{\"type\":\"string\"}},\"type\":\"object\"},\"Street\":{\"properties\":{\"number\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.1\",\"paths\":{\"/valid-addresses\":{\"post\":{\"operationId\":\"validateAddress\",\"parameters\":[],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"}}}}}}"
}
}
]
13 changes: 9 additions & 4 deletions backstage/examples/billing-service/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
"kind": "Component",
"metadata": {
"name": "billing-service",
"links": [{
"url": "http://localhost:30081/webjars/swagger-ui/index.html",
"title": "Billing Service"
}],
"annotations": {
"backstage.io/managed-by-origin-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml",
"backstage.io/managed-by-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml"
}
},
"spec": {
"type": "service",
"type": "business-api",
"description": "This is the description of the billing service.",
"lifecycle": "experimental",
"owner": "guests",
"owner": "ok-user-team",
"providesApis": [
"billing-service-api"
],
Expand All @@ -32,8 +37,8 @@
"spec": {
"type": "openapi",
"lifecycle": "experimental",
"owner": "guests",
"definition": "{\"components\":{\"schemas\":{\"Address\":{\"properties\":{\"city\":{\"$ref\":\"#/components/schemas/City\",\"example\":\"26122 Oldenburg\",\"type\":\"object\"},\"street\":{\"$ref\":\"#/components/schemas/Street\",\"type\":\"object\"},\"recipient\":{\"$ref\":\"#/components/schemas/Recipient\",\"example\":\"Max Mustermann\",\"type\":\"object\"}},\"type\":\"object\"},\"Recipient\":{\"example\":\"Max Mustermann\",\"properties\":{},\"type\":\"object\"},\"Street\":{\"properties\":{\"number\":{\"example\":\"1\",\"type\":\"string\"},\"name\":{\"example\":\"Poststr.\",\"type\":\"string\"}},\"type\":\"object\"},\"City\":{\"example\":\"26122 Oldenburg\",\"properties\":{},\"type\":\"object\"}}},\"openapi\":\"3.0.1\",\"paths\":{\"/billing-addresses/{customerNumber}\":{\"get\":{\"operationId\":\"getAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"description\":\"default response\"}}},\"post\":{\"operationId\":\"setAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"}}}}}}"
"owner": "ok-user-team",
"definition": "{\"servers\":[{\"url\":\"http://localhost:30081\"}],\"components\":{\"schemas\":{\"Address\":{\"properties\":{\"city\":{\"$ref\":\"#/components/schemas/City\",\"example\":\"26122 Oldenburg\",\"type\":\"object\"},\"street\":{\"$ref\":\"#/components/schemas/Street\",\"type\":\"object\"},\"recipient\":{\"$ref\":\"#/components/schemas/Recipient\",\"example\":\"Max Mustermann\",\"type\":\"object\"}},\"type\":\"object\"},\"Recipient\":{\"example\":\"Max Mustermann\",\"properties\":{},\"type\":\"object\"},\"Street\":{\"properties\":{\"number\":{\"example\":\"1\",\"type\":\"string\"},\"name\":{\"example\":\"Poststr.\",\"type\":\"string\"}},\"type\":\"object\"},\"City\":{\"example\":\"26122 Oldenburg\",\"properties\":{},\"type\":\"object\"}}},\"openapi\":\"3.0.1\",\"paths\":{\"/billing-addresses/{customerNumber}\":{\"get\":{\"operationId\":\"getAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"description\":\"default response\"}}},\"post\":{\"operationId\":\"setAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"nullable\":true,\"properties\":{},\"type\":\"object\"}}},\"description\":\"default response\"}}}}}}"
}
}
]
15 changes: 11 additions & 4 deletions backstage/examples/customer-service/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
"kind": "Component",
"metadata": {
"name": "customer-service",
"links": [{
"url": "http://localhost:30082/webjars/swagger-ui/index.html",
"title": "Customer Service"
}],
"annotations": {
"backstage.io/managed-by-origin-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml",
"backstage.io/managed-by-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml"
}
},
"spec": {
"type": "service",
"type": "public-api",
"description": "This is the description of the customer service.",
"lifecycle": "experimental",
"owner": "guests",
"owner": "ok-user-team",
"providesApis": ["customer-service-api"],
"consumesApis": []
}
Expand All @@ -22,6 +27,8 @@
"kind": "API",
"metadata": {
"name": "customer-service-api",
"description": "This is the description of the customer service api.",
"title": "Customer Service API",
"annotations": {
"backstage.io/managed-by-origin-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml",
"backstage.io/managed-by-location": "url:http://localhost:9080/service-repository/api/backstage/catalog-info.yaml"
Expand All @@ -30,8 +37,8 @@
"spec": {
"type": "openapi",
"lifecycle": "experimental",
"owner": "guests",
"definition": "{\"components\":{\"schemas\":{\"Address\":{\"properties\":{\"city\":{\"example\":\"26122 Oldenburg\",\"type\":\"string\"},\"street\":{\"$ref\":\"#/components/schemas/Street\",\"type\":\"object\"},\"recipient\":{\"example\":\"Max Mustermann\",\"type\":\"string\"}},\"type\":\"object\"},\"Street\":{\"properties\":{\"number\":{\"example\":\"1\",\"type\":\"string\"},\"name\":{\"example\":\"Poststr.\",\"type\":\"string\"}},\"type\":\"object\"},\"Customer\":{\"properties\":{\"number\":{\"example\":\"0815\",\"type\":\"string\"},\"deliveryAddress\":{\"$ref\":\"#/components/schemas/Address\"},\"name\":{\"example\":\"Max Mustermann\",\"type\":\"string\"},\"billingAddress\":{\"$ref\":\"#/components/schemas/Address\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.1\",\"paths\":{\"/customers/{customerNumber}/billing-address\":{\"put\":{\"operationId\":\"setBillingAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"204\":{\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\"}}},\"description\":\"No content\"}}}},\"/customers/{customerNumber}\":{\"get\":{\"operationId\":\"getCustomer\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"}}},\"description\":\"default response\"}}}},\"/customers\":{\"get\":{\"operationId\":\"getCustomers\",\"parameters\":[],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"items\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"},\"type\":\"array\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"items\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"},\"type\":\"array\"}}},\"description\":\"default response\"}}},\"post\":{\"operationId\":\"createCustomer\",\"parameters\":[],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"201\":{\"content\":{\"application/json\":{\"schema\":{}}},\"description\":\"\",\"headers\":{\"Location\":{\"allowEmptyValue\":false,\"deprecated\":false,\"description\":\"contains the url of the created customer\",\"required\":false,\"style\":\"simple\"}}}}}},\"/customers/{customerNumber}/delivery-address\":{\"put\":{\"operationId\":\"setDeliveryAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"204\":{\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\"}}},\"description\":\"No content\"}}}}}}"
"owner": "ok-user-team",
"definition": "{\"servers\":[{\"url\":\"http://localhost:30082\"}],\"components\":{\"schemas\":{\"Address\":{\"properties\":{\"city\":{\"example\":\"26122 Oldenburg\",\"type\":\"string\"},\"street\":{\"$ref\":\"#/components/schemas/Street\",\"type\":\"object\"},\"recipient\":{\"example\":\"Max Mustermann\",\"type\":\"string\"}},\"type\":\"object\"},\"Street\":{\"properties\":{\"number\":{\"example\":\"1\",\"type\":\"string\"},\"name\":{\"example\":\"Poststr.\",\"type\":\"string\"}},\"type\":\"object\"},\"Customer\":{\"properties\":{\"number\":{\"example\":\"0815\",\"type\":\"string\"},\"deliveryAddress\":{\"$ref\":\"#/components/schemas/Address\"},\"name\":{\"example\":\"Max Mustermann\",\"type\":\"string\"},\"billingAddress\":{\"$ref\":\"#/components/schemas/Address\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.1\",\"paths\":{\"/customers/{customerNumber}/billing-address\":{\"put\":{\"operationId\":\"setBillingAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"204\":{\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\"}}},\"description\":\"No content\"}}}},\"/customers/{customerNumber}\":{\"get\":{\"operationId\":\"getCustomer\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"}}},\"description\":\"default response\"}}}},\"/customers\":{\"get\":{\"operationId\":\"getCustomers\",\"parameters\":[],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"items\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"},\"type\":\"array\"}}},\"description\":\"default response\"},\"default\":{\"content\":{\"application/json\":{\"schema\":{\"items\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"},\"type\":\"array\"}}},\"description\":\"default response\"}}},\"post\":{\"operationId\":\"createCustomer\",\"parameters\":[],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Customer\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"201\":{\"content\":{\"application/json\":{\"schema\":{}}},\"description\":\"\",\"headers\":{\"Location\":{\"allowEmptyValue\":false,\"deprecated\":false,\"description\":\"contains the url of the created customer\",\"required\":false,\"style\":\"simple\"}}}}}},\"/customers/{customerNumber}/delivery-address\":{\"put\":{\"operationId\":\"setDeliveryAddress\",\"parameters\":[{\"allowEmptyValue\":false,\"allowReserved\":false,\"description\":\"The business identifier of a customer \",\"example\":\"0815\",\"in\":\"path\",\"name\":\"customerNumber\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Address\",\"type\":\"object\"}}},\"required\":true},\"responses\":{\"204\":{\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\"}}},\"description\":\"No content\"}}}}}}"
}
}
]
Loading

0 comments on commit 222e182

Please sign in to comment.