#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF 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.
#
name: api name
description: api description
resources:
  - path: '/'
    type: restful
    description: resource documentation
    methods:
      - httpVerb: GET
        enable: true
        inboundRequest:
          requestType: http
          headers:
            - name: auth
              required: true
          queryStrings:
            - name: id
              required: false
            - name: type
              required: false
          requestBody:
            - definitionName: modelDefinition
        integrationRequest:
          requestType: dubbo
          mappingParams:
            - name: queryStrings.id
              mapTo: 1
          applicationName: BDTService
          group: test
          version: 1.0.0
          interface: com.ikurento.user.UserProvider
          Method: GetUser
          paramTypes:
            - java.lang.String
          ClusterName: test_dubbo
  - path: '/mockTest'
    type: restful
    description: mockTest
    methods:
      - httpVerb: GET
        enable: true
        inboundRequest:
          requestType: http
          headers: 
            - name: auth
              required: true 
          queryStrings:
            - name: id
              required: false
            - name: type
              required: false
          requestBody:
            - definitionName: modelDefinition
        integrationRequest:
          requestType: dubbo
          mappingParams:
            - name: queryStrings.id
              mapTo: 1
          applicationName: BDTService
          group: test
          version: 1.0.0
          interface: com.ikurento.user.UserProvider
          method: GetUsers
          paramTypes:
            - java.lang.String
          clusterName: test_dubbo
      - httpVerb: POST
        enable: true
        inboundRequest:
          requestType: http
          headers: 
            - name: auth
              required: true 
          queryStrings:
            - name: id
              required: false
            - name: type
              required: false
        integrationRequest:
          requestType: dubbo
          mappingParams:
            - name: queryStrings.id
              mapTo: 1
          applicationName: BDTService
          group: test
          version: 1.0.0
          interface: com.ikurento.user.UserProvider
          method: NewUser
          paramTypes:
            - java.lang.String
          clusterName: test_dubbo
    resources:
      - path: '/:id'
        type: restful
        description: resource documentation
        methods:
          - httpVerb: GET
            enable: true
            inboundRequest:
              requestType: http
              headers: 
                - name: auth
                  required: true 
              queryStrings:
                - name: id
                  required: true
            integrationRequest:
              requestType: dubbo
              mappingParams:
                - name: queryStrings.id
                  mapTo: 1
              applicationName: BDTService
              group: test
              version: 1.0.0
              interface: com.ikurento.user.UserProvider
              method: GetUser
              paramTypes:
                - java.lang.String
              clusterName: test_dubbo
          
definitions:
  - name: modelDefinition
    schema: >-
      {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer"
          },
          "type" : {
            "type" : "string"
          },
          "price" : {
            "type" : "number"
          }
        }
      }
