- Issue created by @kopeboy
I'm trying to get this response with this module.
My my_custom_module.http_services_api.yml
:
monkey:
title: MonKey
api_path: /api/monkey.yml
config:
base_uri: https://monkey.banano.cc
stream: true
(I've tried both with or without stream:true
).
My my_custom_module/api/monkey.yml
:
name: MonKey
apiVersion: v1
description: Returns a MonKey SVG for each banano address
imports:
- resources/banano/monkey.yml
My my_custom_module/api/resources/banano/monkey.xml
:
operations:
GetSVG:
httpMethod: GET
uri: "/api/v1/monkey/{address}"
summary: "SVG by Banano address"
responseModel: SVG
parameters:
address:
location: uri
description: "Banano address"
type: string
required: true
format:
location: query
description: Format (svg/png/webp)
type: string
size:
location: query
description: Pixel size (100<=128<=1000)
type: integer
background:
location: query
description: Colored background (false)
type: boolean
models:
SVG:
type: object
location: json
The operations should be OK, and problem is probably in the SVG model. I've tried with:
type: object
location: xml
type: object
location: json
but the response is always empty, with no errors logged:
The simple API, as you can see at https://monkey.banano.cc/documentation, can return either SVG, PNG or Webp files, and I plan to save either of them (preferably svg) as Drupal-managed files, to be referenced by a content entity.
Active
10.0
Documentation