Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spike] End to End test Shopping example in cloud with APIConnect #4498

Closed
2 tasks done
deepakrkris opened this issue Jan 24, 2020 · 14 comments
Closed
2 tasks done

[Spike] End to End test Shopping example in cloud with APIConnect #4498

deepakrkris opened this issue Jan 24, 2020 · 14 comments
Assignees
Milestone

Comments

@deepakrkris
Copy link
Contributor

deepakrkris commented Jan 24, 2020

Test prerequisites

  1. Modify the shopping app to include the APIC OpenAPI enhancer. This allows the LB-generated OpenAPI spec includes APIC specific metadata.
  2. Deploy shopping example in a cloud service (ibm , aws, etc)
  3. Generate open api spec for all the api endpoints and services from the shopping example
  4. Make minor modifications to the imported api spec, as per suggestions in spike [Spike] API Connect / LoopBack 4 integration #4115 This is no longer needed (hopefully) with the APIC OpenAPI enhancer
  5. Publish all APIs to an APIC instance
  6. End to End test shopping example thru APIC datapower gateway.

Acceptance criteria

We should ensure:

  • All shopping example endpoints are invocable thru IBM APIConnect
  • All security features in the shopping example are tested

See the specific tests needed in the shopping app tests on top of the todo list app test: #4498 (comment)

Shopping app test is required for:

  1. Testing for authentication and authorization
  2. Various model relations
  3. Various filter and query options

cc @raymondfeng @bajtos @dhmlau

@dhmlau
Copy link
Member

dhmlau commented Jan 27, 2020

Deploy shopping example in a cloud service (ibm , aws, etc)

Since the purpose is to try out the integration instead of testing on different cloud services, I'd suggest we simply use IBM Cloud. It might be easier since we've done that before, and less learning curve there.

@emonddr
Copy link
Contributor

emonddr commented Jan 28, 2020

@deepakrkris , while you are doing this, please create an internal document (for the loopback team) of all the steps you had to perform to set this up and test API Connect. Thanks.

@deepakrkris
Copy link
Contributor Author

@dhmlau let me try to do some simple tests with IBM cloud and see if it is doable. AWS was much simpler for me.

@dhmlau dhmlau added this to the Feb 2020 milestone Jan 28, 2020
@dhmlau
Copy link
Member

dhmlau commented Jan 30, 2020

@deepakrkris, I'd like to have a proper priority on this task, so I have a few questions:

Thanks.

@deepakrkris
Copy link
Contributor Author

@deepakrkris, I'd like to have a proper priority on this task, so I have a few questions:

Thanks.
would like to have a proper priority on this task.

Shopping app test is required for:

  1. Testing for authentication and authorization
  2. Various model relations
  3. Various filter and query options

Todo example comparatively has very less scope for testing.

@dhmlau
Copy link
Member

dhmlau commented Jan 31, 2020

Thanks. Let me add it to the acceptance criteria too.

@dhmlau dhmlau removed this from the Feb 2020 milestone Jan 31, 2020
@dhmlau dhmlau added p2 and removed p2 labels Feb 13, 2020
@dhmlau dhmlau added this to the April 2020 milestone Mar 17, 2020
@deepakrkris deepakrkris self-assigned this Apr 7, 2020
@deepakrkris
Copy link
Contributor Author

deepakrkris commented Apr 27, 2020

I have did an end to end test of shopping app (deployed to IBM Cloud, http://184.172.242.157:32719 ) with IBM APIConnect (gateway url : https://kraken-rgw.loki.dev.ciondemand.com/ibm/sandbox).
ibm-apiconnect-shopping-app.zip

  • 1 Created user curl -X POST -k -H 'Content-Type: application/json' -H 'Accept: application/json' -i 'https://kraken-rgw.loki.dev.ciondemand.com/ibm/sandbox/users' --data '{ "email": "[email protected]", "firstName": "arun", "lastName": "raja", "password": "password" }'

  • 2 logged in with user curl -X POST -k -H 'Accept: application/json' -H 'Content-Type: application/json' -i 'https://kraken-rgw.loki.dev.ciondemand.com/ibm/sandbox/users/login' --data '{ "email": "[email protected]", "password": "password" }'

  • 3 Created a shopping cart curl -X POST -k -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlYTY3N2JjMmI3YzVkZTAyNjZjOWQxYSIsIm5hbWUiOiJhcnVuIHJhamEiLCJyb2xlcyI6WyJjdXN0b21lciJdLCJpYXQiOjE1ODc5NjgwNzcsImV4cCI6MTU4Nzk2ODY3N30.4f4Rnm_PFEG4y4tzdOnRQchx7lEGd7Mstnug07xy01g' -i 'https://kraken-rgw.loki.dev.ciondemand.com/ibm/sandbox/shoppingCarts/5ea677bc2b7c5de0266c9d1a' --data '{ "userId": "5ea677bc2b7c5de0266c9d1a", "items": [ { "productId": "5e9812012b7c5d0a9c6c9d09", "name": "Sony Camera", "quantity": 1, "price": 2100 } ] }'

  • 4 added items in the cart and then posted an order curl -X GET -k -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlYTY3N2JjMmI3YzVkZTAyNjZjOWQxYSIsIm5hbWUiOiJhcnVuIHJhamEiLCJyb2xlcyI6WyJjdXN0b21lciJdLCJpYXQiOjE1ODc5NjkxMzksImV4cCI6MTU4Nzk2OTczOX0.jIQGl5-f9Cm5L-9rIOSqgjCrKX-2DZsSaDzLkuvirtE' -H 'Accept: application/json' -H 'Content-Type: application/json' -i 'https://kraken-rgw.loki.dev.ciondemand.com/ibm/sandbox/users/5ea677bc2b7c5de0266c9d1a/orders' --data '{ "date": "2020-04-27T06:35:22.988Z", "userId": "5ea677bc2b7c5de0266c9d1a", "fullName": "arun raja", "total": 0, "products": [ {"productId":"5e9812012b7c5d0a9c6c9d09","name":"Sony Camera","quantity":1,"price":2100}, {"productId":"5e9812022b7c5dc5396c9d0e","name":"Samsung Laptop","quantity":2,"price":4200} ] }'

@deepakrkris
Copy link
Contributor Author

I was able to publish the shopping product in previous example ./apic products:publish -s kraken.loki.dev.ciondemand.com -o ibm -c sandbox shopping-prod.json
Also the JWT token was passed in the Authorization header for all secured endpoints.

@deepakrkris
Copy link
Contributor Author

deepakrkris commented Apr 27, 2020

original apen-api spec downloaded from the shopping app http://184.172.242.157:32719/openapi.json

{ "openapi": "3.0.0", "info": { "title": "loopback4-example-shopping", "version": "1.2.0", "description": "LoopBack 4 Example: Online Shopping APIs", "contact": { "name": "LoopBack contributors", "email": "[email protected]", "url": "https://loopback.io" } }, "paths": { "/ping": { "get": { "x-controller-name": "PingController", "x-operation-name": "ping", "tags": [ "PingController" ], "responses": { "200": { "description": "Ping Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "greeting": { "type": "string" }, "date": { "type": "string" }, "url": { "type": "string" }, "headers": { "type": "object", "properties": { "Content-Type": { "type": "string" } }, "additionalProperties": false } } } } } } }, "operationId": "PingController.ping" } }, "/products/count": { "get": { "x-controller-name": "ProductController", "x-operation-name": "count", "tags": [ "ProductController" ], "responses": { "200": { "description": "Product model count", "content": { "application/json": { "schema": { "type": "object", "title": "loopback.Count", "properties": { "count": { "type": "number" } } } } } } }, "parameters": [ { "name": "where", "in": "query", "content": { "application/json": { "schema": { "type": "object", "title": "Product.WhereFilter", "additionalProperties": true } } } } ], "operationId": "ProductController.count" } }, "/products/{id}": { "put": { "x-controller-name": "ProductController", "x-operation-name": "replaceById", "tags": [ "ProductController" ], "security": [ { "jwt": [] } ], "responses": { "204": { "description": "Product PUT success" } }, "parameters": [ { "name": "id", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Product" } } }, "x-parameter-index": 1 }, "operationId": "ProductController.replaceById" }, "patch": { "x-controller-name": "ProductController", "x-operation-name": "updateById", "tags": [ "ProductController" ], "security": [ { "jwt": [] } ], "responses": { "204": { "description": "Product PATCH success" } }, "parameters": [ { "name": "id", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductPartial" } } }, "x-parameter-index": 1 }, "operationId": "ProductController.updateById" }, "get": { "x-controller-name": "ProductController", "x-operation-name": "findById", "tags": [ "ProductController" ], "responses": { "200": { "description": "Product model instance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductWithRelations" } } } } }, "parameters": [ { "name": "id", "in": "path", "schema": { "type": "string" }, "required": true }, { "name": "filter", "in": "query", "content": { "application/json": { "schema": { "type": "object", "title": "Product.Filter", "properties": { "offset": { "type": "integer", "minimum": 0 }, "limit": { "type": "integer", "minimum": 1, "example": 100 }, "skip": { "type": "integer", "minimum": 0 }, "order": { "type": "array", "items": { "type": "string" } }, "where": { "title": "Product.WhereFilter", "type": "object", "additionalProperties": true }, "fields": { "title": "Product.Fields", "type": "object", "properties": { "productId": { "type": "boolean" }, "name": { "type": "boolean" }, "price": { "type": "boolean" }, "image": { "type": "boolean" }, "description": { "type": "boolean" }, "details": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false } } } } ], "operationId": "ProductController.findById" }, "delete": { "x-controller-name": "ProductController", "x-operation-name": "deleteById", "tags": [ "ProductController" ], "security": [ { "jwt": [] } ], "responses": { "204": { "description": "Product DELETE success" } }, "parameters": [ { "name": "id", "in": "path", "schema": { "type": "string" }, "required": true } ], "operationId": "ProductController.deleteById" } }, "/products": { "post": { "x-controller-name": "ProductController", "x-operation-name": "create", "tags": [ "ProductController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "Product model instance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Product" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewProduct" } } } }, "operationId": "ProductController.create" }, "patch": { "x-controller-name": "ProductController", "x-operation-name": "updateAll", "tags": [ "ProductController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "Product PATCH success count", "content": { "application/json": { "schema": { "type": "object", "title": "loopback.Count", "properties": { "count": { "type": "number" } } } } } } }, "parameters": [ { "name": "where", "in": "query", "content": { "application/json": { "schema": { "type": "object", "title": "Product.WhereFilter", "additionalProperties": true } } } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductPartial" } } } }, "operationId": "ProductController.updateAll" }, "get": { "x-controller-name": "ProductController", "x-operation-name": "find", "tags": [ "ProductController" ], "responses": { "200": { "description": "Array of Product model instances", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ProductWithRelations" } } } } } }, "parameters": [ { "name": "filter", "in": "query", "content": { "application/json": { "schema": { "type": "object", "title": "Product.Filter", "properties": { "offset": { "type": "integer", "minimum": 0 }, "limit": { "type": "integer", "minimum": 1, "example": 100 }, "skip": { "type": "integer", "minimum": 0 }, "order": { "type": "array", "items": { "type": "string" } }, "where": { "title": "Product.WhereFilter", "type": "object", "additionalProperties": true }, "fields": { "title": "Product.Fields", "type": "object", "properties": { "productId": { "type": "boolean" }, "name": { "type": "boolean" }, "price": { "type": "boolean" }, "image": { "type": "boolean" }, "description": { "type": "boolean" }, "details": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false } } } } ], "operationId": "ProductController.find" } }, "/shoppingCarts/{userId}/items": { "post": { "x-controller-name": "ShoppingCartController", "x-operation-name": "addItem", "tags": [ "ShoppingCartController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "User shopping cart item is created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShoppingCart" } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "description": "shopping cart item", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShoppingCartItem" } } }, "x-parameter-index": 1 }, "operationId": "ShoppingCartController.addItem" } }, "/shoppingCarts/{userId}": { "post": { "x-controller-name": "ShoppingCartController", "x-operation-name": "create", "tags": [ "ShoppingCartController" ], "security": [ { "jwt": [] } ], "responses": { "204": { "description": "User shopping cart is created or updated" } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "description": "shopping cart", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShoppingCart" } } }, "x-parameter-index": 1 }, "operationId": "ShoppingCartController.create" }, "put": { "x-controller-name": "ShoppingCartController", "x-operation-name": "set", "tags": [ "ShoppingCartController" ], "security": [ { "jwt": [] } ], "responses": { "204": { "description": "User shopping cart is created or updated" } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "description": "shopping cart", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShoppingCart" } } }, "x-parameter-index": 1 }, "operationId": "ShoppingCartController.set" }, "get": { "x-controller-name": "ShoppingCartController", "x-operation-name": "get", "tags": [ "ShoppingCartController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "User shopping cart is read", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShoppingCart" } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "operationId": "ShoppingCartController.get" }, "delete": { "x-controller-name": "ShoppingCartController", "x-operation-name": "remove", "tags": [ "ShoppingCartController" ], "security": [ { "jwt": [] } ], "responses": { "204": { "description": "User shopping cart is deleted" } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "operationId": "ShoppingCartController.remove" } }, "/users/login": { "post": { "x-controller-name": "UserController", "x-operation-name": "login", "tags": [ "UserController" ], "responses": { "200": { "description": "Token", "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string" } } } } } } }, "requestBody": { "description": "The input of login function", "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string", "format": "email" }, "password": { "type": "string", "minLength": 8 } } } } } }, "operationId": "UserController.login" } }, "/users/me": { "get": { "x-controller-name": "UserController", "x-operation-name": "printCurrentUser", "tags": [ "UserController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "The current user profile", "content": { "application/json": { "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" } } } } } } }, "operationId": "UserController.printCurrentUser" } }, "/users/{userId}/orders": { "post": { "x-controller-name": "UserOrderController", "x-operation-name": "createOrder", "tags": [ "UserOrderController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "User.Order model instance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } }, "x-parameter-index": 1 }, "operationId": "UserOrderController.createOrder" }, "patch": { "x-controller-name": "UserOrderController", "x-operation-name": "patchOrders", "tags": [ "UserOrderController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "User.Order PATCH success count", "content": { "application/json": { "schema": { "type": "object", "title": "loopback.Count", "properties": { "count": { "type": "number" } } } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true }, { "name": "where", "in": "query", "content": { "application/json": { "schema": { "type": "object", "title": "Order.WhereFilter", "additionalProperties": true } } } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } }, "x-parameter-index": 1 }, "operationId": "UserOrderController.patchOrders" }, "get": { "x-controller-name": "UserOrderController", "x-operation-name": "findOrders", "tags": [ "UserOrderController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "Array of User's Orders", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Order" } } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true }, { "name": "filter", "in": "query", "content": { "application/json": { "schema": { "type": "object", "title": "Order.Filter", "properties": { "offset": { "type": "integer", "minimum": 0 }, "limit": { "type": "integer", "minimum": 1, "example": 100 }, "skip": { "type": "integer", "minimum": 0 }, "order": { "type": "array", "items": { "type": "string" } }, "where": { "title": "Order.WhereFilter", "type": "object", "additionalProperties": true }, "fields": { "title": "Order.Fields", "type": "object", "properties": { "orderId": { "type": "boolean" }, "date": { "type": "boolean" }, "userId": { "type": "boolean" }, "fullName": { "type": "boolean" }, "total": { "type": "boolean" }, "products": { "type": "boolean" } }, "additionalProperties": false }, "include": { "title": "Order.IncludeFilter", "type": "array", "items": { "title": "Order.IncludeFilter.Items", "type": "object", "properties": { "relation": { "type": "string" }, "scope": { "properties": { "offset": { "type": "integer", "minimum": 0 }, "limit": { "type": "integer", "minimum": 1, "example": 100 }, "skip": { "type": "integer", "minimum": 0 }, "order": { "type": "array", "items": { "type": "string" } }, "where": { "type": "object", "additionalProperties": true }, "fields": { "type": "object", "properties": {}, "additionalProperties": true } }, "additionalProperties": false, "title": "Order.ScopeFilter" } } } } }, "additionalProperties": false } } } } ], "operationId": "UserOrderController.findOrders" }, "delete": { "x-controller-name": "UserOrderController", "x-operation-name": "deleteOrders", "tags": [ "UserOrderController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "User.Order DELETE success count", "content": { "application/json": { "schema": { "type": "object", "title": "loopback.Count", "properties": { "count": { "type": "number" } } } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true }, { "name": "where", "in": "query", "content": { "application/json": { "schema": { "type": "object", "title": "Order.WhereFilter", "additionalProperties": true } } } } ], "operationId": "UserOrderController.deleteOrders" } }, "/users/{userId}/recommend": { "get": { "x-controller-name": "UserController", "x-operation-name": "productRecommendations", "tags": [ "UserController" ], "responses": { "200": { "description": "Products", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Product" } } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "operationId": "UserController.productRecommendations" } }, "/users/{userId}": { "put": { "x-controller-name": "UserController", "x-operation-name": "set", "tags": [ "UserController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "User", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "description": "update user", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } }, "x-parameter-index": 2 }, "operationId": "UserController.set" }, "get": { "x-controller-name": "UserController", "x-operation-name": "findById", "tags": [ "UserController" ], "security": [ { "jwt": [] } ], "responses": { "200": { "description": "User", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } } }, "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "string" }, "required": true } ], "operationId": "UserController.findById" } }, "/users": { "post": { "x-controller-name": "UserController", "x-operation-name": "create", "tags": [ "UserController" ], "responses": { "200": { "description": "User", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewUser" } } } }, "operationId": "UserController.create" } } }, "servers": [ { "url": "/" } ], "components": { "schemas": { "Product": { "title": "Product", "properties": { "productId": { "type": "string" }, "name": { "type": "string" }, "price": { "type": "number" }, "image": { "type": "string" }, "description": { "type": "string" }, "details": { "type": "string" } }, "required": [ "name", "price" ], "additionalProperties": false }, "NewProduct": { "title": "NewProduct", "description": "(Schema options: { title: 'NewProduct', exclude: [ 'productId' ] })", "properties": { "name": { "type": "string" }, "price": { "type": "number" }, "image": { "type": "string" }, "description": { "type": "string" }, "details": { "type": "string" } }, "required": [ "name", "price" ], "additionalProperties": false }, "ProductWithRelations": { "title": "ProductWithRelations", "description": "(Schema options: { includeRelations: true })", "properties": { "productId": { "type": "string" }, "name": { "type": "string" }, "price": { "type": "number" }, "image": { "type": "string" }, "description": { "type": "string" }, "details": { "type": "string" } }, "required": [ "name", "price" ], "additionalProperties": false }, "ProductPartial": { "title": "ProductPartial", "description": "(Schema options: { partial: true })", "properties": { "productId": { "type": "string" }, "name": { "type": "string" }, "price": { "type": "number" }, "image": { "type": "string" }, "description": { "type": "string" }, "details": { "type": "string" } }, "additionalProperties": false }, "ShoppingCartItem": { "title": "ShoppingCartItem", "properties": { "productId": { "type": "string" }, "name": { "type": "string" }, "quantity": { "type": "number" }, "price": { "type": "number" } }, "additionalProperties": false }, "ShoppingCart": { "title": "ShoppingCart", "properties": { "userId": { "type": "string" }, "items": { "type": "array", "items": { "$ref": "#/components/schemas/ShoppingCartItem" } } }, "additionalProperties": false }, "Order": { "title": "Order", "properties": { "orderId": { "type": "string" }, "date": { "type": "string", "format": "date-time" }, "userId": { "type": "string" }, "fullName": { "type": "string" }, "total": { "type": "number" }, "products": { "type": "array", "items": { "$ref": "#/components/schemas/ShoppingCartItem" } } }, "required": [ "products" ], "additionalProperties": false }, "User": { "title": "User", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } } }, "required": [ "email" ], "additionalProperties": false }, "NewUser": { "title": "NewUser", "description": "(Schema options: { title: 'NewUser' })", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "password": { "type": "string" } }, "required": [ "email", "password" ], "additionalProperties": false }, "NewUserRequest": { "title": "NewUserRequest", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "password": { "type": "string" } }, "required": [ "email", "password" ], "additionalProperties": false } }, "securitySchemes": { "jwt": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } } }

@deepakrkris
Copy link
Contributor Author

deepakrkris commented Apr 27, 2020

I had to edit the original json spec for a very tiny change: adding the mandatory x-ibm-name to the info header in the api spec

"info": {
      "x-ibm-name": "loopback4-example-shopping",
      "title": "loopback4-example-shopping",
      "version": "1.2.0",
      "description": "LoopBack 4 Example: Online Shopping APIs",
      "contact": {
        "name": "LoopBack contributors",
        "email": "[email protected]",
        "url": "https://loopback.io"
      }

I also had to change the security scheme type from bearer to basic because APIConnect does not support open api scheme bearer for now.

      "securitySchemes": {
        "jwt": {
          "type": "http",
          "scheme": "basic"
        }
      }

@deepakrkris
Copy link
Contributor Author

follow up issue opened for minor change #5259

@deepakrkris
Copy link
Contributor Author

Changes are also published to IBM Developer portal

Screen Shot 2020-04-27 at 12 19 43 AM

Able to browse through all api routes in portal

Screen Shot 2020-04-27 at 12 21 18 AM

Screen Shot 2020-04-27 at 12 22 03 AM

@deepakrkris
Copy link
Contributor Author

IBM Developer portal seems to digest all api schema

Screen Shot 2020-04-27 at 12 24 29 AM

@deepakrkris
Copy link
Contributor Author

Spike is complete now, acceptance criteria is satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants