Claudia.js jasmine post/put body key - jasmine-node

I'm using claudia-api-builder and attempting to write tests using jasmine-node. I'm using the proxyRouter on my API using this tutorial https://claudiajs.com/tutorials/testing-locally.html, and I can pass path parameters fine as demonstrated. However, I can't find what the key is for the body of the request.
For example it says
You can fill in the other properties (eg queryStringParameters)
according to what the test expects
But I can't find anywhere that lists the possible properties. The API Gateway Proxy Object link also doesn't seem to go to anything useful, as the sample doesn't seem to include a body.
Does anybody know what the key I should be using is? Thanks!

Worked it out - somewhat embarrassingly it's just body.

Related

Reverse Engineering an auth code query parameter passed to Play Framework in URL query Parameter

I recently got thrown into a company to do DD on a SaaS solution that needs to generate codes to send invites. Has anyone seen or used this method of passing an API key/auth code? It's using the Play Framework. I don't have access to the play source code, just a compiled binary so I can't even see how the GET request is validated.
Eg:
https://<site.com>/?auth=10002-1644542228446-75ac043770463c36039f29d75304171c
I checked the packages used and there is io.jsonwebtoken.jjwt-0.9.1.jar used but I'm only familiar with passing it as a header "Bearer ". and haven't seen this three segmented formatting. XXXXX-XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Any help would be appreciated. I know it's not a lot to go off but I'm only looking to be pointed at the method used to get started.

Simple API call within the context of DocFx preprocessor

I would like to know if it is possible to make a simple API call (e.g. GitHub API v3) within the context of a DocFx custom template preprocessor. I have been trying all sorts of different approaches, but nothing has fully worked so far.
My goal is to make a call to an API to retrieve some data, and then update the model accordingly to be used in the *.liquid or *.tmpl renderers.
I have tried using the http/https node modules. I have also tried using node-fetch. It results in a docfx build error something like:
Error:Error transforming model ".../index.raw.json" generated from
".../index.md" using "conceptual.html.primary.js". Error running
Transform function inside template preprocessor
According to DocFx documentation, preprocessors follow the ES 5.1 standard. My code conforms to this.
Does anyone know if this is possible?
By the way, I am able to do simple model manipulation just fine, so I understand the basic concepts here with the DocFx preprocessors.
Thanks!
For the benefit of others, I discovered DocFX uses jint which cannot require a Node library directly. Therefore, it appears the plugin route is a better way to go for this use case.

Advanced REST Client: adding query parameters

Advanced REST Client seems like a neat REST client implementation to try REST-APIs.
But, I can't find how I can add query parameters to the URI of the API, but without putting it up the with the URI itself.
for example, to generate some URL like
https://api.example.com/v2/users/?age=25&fanOf=lakers
i want to add parameters like "age"=25 and "fanOf"="lakers".
i know it's there somewhere but can't find it plainly on, otherwise intuitive interface, `Advanced REST client".
After a bit of failed exploration on Internet & SO of-course, got it from a tip of a co-worker.
The option opens up by clicking the down-arrow on the left-side of the url-box.
Screenshot with new version 12.1.4 of ARC client

SoapUI REST webservice mock with path parameters

I am trying to create a mock webservice for a POST method on SoapUI. I made a REST Project, then created a MockService, a MockAction and defined a couple responses and resource paths. It works fine if I define a fixed regular path relative to my Service, for example method/postmethod to be invoked at http://localhost:8080/method/post, it works well.
What I want to do, however, is define my method with path parameters, such as this: http://localhost:8080/method/{par1}/{par2}/{par3}/post. The application we want to test, which will be invoking our mock service, uses this type of parameter extensively, so we cannot just create one method for each possible combination.
Is it possible to define a mock POST method with that type of path parameter? Is it possible to parse the parameters and use them in the output response? If yes, then how?
Please enable the script method in responding the request that came to mock, there is a default script posted by soapui , which tells how to access the path parameters, headers, body . please use that , attached the pic for reference.

How to get request properties in routeStartup plugin method?

I'm developing a multilanguage application, and use routes with translated segments. For multilingual support I created special Multilingual plugin.
To use translated segments I need set translator for Zend_Controller_Router_Route before routes init. So only possible place for this in my plugin is routeStartup method, but there is one problem here - for determine right locale I need to use properties of request (Zend_Controller_Request_Abstract), like module, controller and action names, but they are not defined yet here in routeStartup method. They are already defined, for example, in routeShutdown - but I can't set translator for route there, because it have to be done before routes init.
So what can I do:
can I get request properties somehow in routeStartup
or can I re-setup translator later in routeShutdown
P.S: there is a question with exactly the same problem Zend_Controller_Router_Route: Could not find a translator, but proposed answers is not the option for me, because I can't just retrieve language code from url with Regex, I have much more complicated code to define right language code.
Thanks.
What about putting your code in preDispatch? That's what I personally do when I need to check if the person is logged in. Maybe you can move your code there too?