Swagger 3.x : Query params act as readonly values - swagger

I tried swagger 3.2.2 by running a GET operation with few query params.
I find defaults values I set in REST API can't override in swagger UI. All the text boxes are read only, and drop-down of Boolean query param always sends 'false' though I select it to 'true'. It seems program default values are super hard-corded here. I was playing with swagger #ApiPram(..) to fix this but it didn't help me.
Did anyone ran in to the same issue I describe above with Swagger 3.x?

I start using Swagger UI 3.5.0 and fixed the issue

Related

Swagger Codegen Spring Converters

I am using swagger(openapi) codegen to generate Rest Api Server Stub.
Is it possible to use the "spring" generator and somehow use Spring Rest converters ?
The problem is that before I had a simple
#GetMapping
public String (#RequestBody Locale locale)
Now with openapi codegen I have an ugly LocaleDto that has 50 fields and so on. And also I need to manually transform my object back to "Locale" with
LocaleUtils.from().
Relative docs:
https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen-maven-plugin/README.md
Any help is greatly appreciated.

Swagger - API path & fixed parameter

I'm trying to put in swagger for documentation the link below.
https://server.dc.ege.ds:50001/XMII/Runner?Transaction=SC_AUTOMATION/API/SCRAP_LIST/SCRAP_LIST&OutputParameter=ResultXML&Plant=1345&Plant=1345&BookingdateFrom=2022-08-31T10%3A57%3A44
I see a particulariry of having my endpoint "/Runner?" followed by "Transaction=SC_AUTOMATION/API/SCRAP_LIST/SCRAP_LIST" I don't know ho to explicit it in swagger.
OutputParameter=ResultXML is currently a parameter but in fact there is no other possibily than "ResulXML" any possibility to define it as fixed ?
thanks a lot for your reading

Removing default values from repsonse example model in swagger UI Java

I have swagger UI configured and it is showing by default values in response example. Need to remove this default values.

Adding dynamic path parameters into Orbeon Form HTTP Service

I'm trying to add a dynamic path parameter into an HTTP service in Orbeon forms, ie call a specific URL based on the content of a form field. I know we can change the query string parameters but I need to change the URL itself - the one in this field:
I've read that this is possible in newer version of Orbeon forms by using
{fr:control-string-value('testField')}
but we are stuck on an older version.
I saw another question on Stack Overflow from a few years ago: Orbeon Form HTTP Service where #ebruchez explained xpath is executed in the Resource URL field and gave the example:
http://localhost/RESTFUL/GETADDRESS/{/*/bar/foo}
However, I can't get this to work.
I have been able to successfully execute XPath, eg:
{string-join("test", "value")}
But I don't seem to be able to work out the correct Xpath syntax to dynamically select the value of a sample field and insert it into this box. I think I'm missing something in how I construct the XPath to retrieve the value.
This is what I've tried so far:
{xxf:value('testField')}
{xxf:value($testField)}
{fr:control-value($testField)}
{fr:control-value('testField')}
{xxf:property('testField')}
{xxf:property($testField)}
{$testField}
{'testField'}
{xxf:get-request-parameter('testField')}
{xxf:bind('testField')}
{/*/testField/}
{/*/content/testField/}
{//testField/}
{//*:testField/}
{//:testField/}
{(//testField)[1].text()}
{//form/content/testField/text()}
{(//testField)[1]/text()}
If anyone has any hints of advice on what I'm doing wrong or could give me an example of the syntax I put in here to retrieve a value, I'd be eternally grateful.
You can use AVT (Attribute Value Templates) https://doc.orbeon.com/xforms/core/attribute-value-templates?q=avt. In resource in <xf:submission> or HTTP service wizard use e.g. {instance('fr-form-instance')//url} or if you want edit only some part of URL you can use http://httpbin.org/{instance('fr-form-instance')//url}. I make simple form for you https://demo.orbeon.com/demo/fr/orbeon/builder/edit/18c4bee259fd9f398238b3c72041ee43ea691aa7 witch save respose to dataset and have second example in resource.
Hope this help you

Can I achieve AND instead of OR in Swagger API generated by JHipster?

I set up a basic JHipster project and generated an entity that supports filtering with JDL.
The generator made a Swagger API which I use for querying the database.
The Swagger API doc shows me a list of parameters which can be used to build query.
The template query looks like this:
GET /api/client?name.equals=john&surname.equals=doe&country.in=uk&country.in=de
The request works fine but the parameters are chained like name==john OR surname==doe OR country==uk OR country==de so I get all johns, does, and everoyne from uk and de.
This is ok, but for some queries i need name==john AND surname==doe so not all Johns and Does but specifically John Doe. I searched here and on the swagger forum but couldn't find the answer.
My question is: how do I achieve changing the OR to AND in the query?
Does this swagger query support AND or do I have to make changes in the backend?
Your question is not about swagger, this is why you could not find anything in swagger forum.
It's about JHipster JPA entity filtering and the answer is no: you can't generate code that would use a OR.
You must code it yourself, look at the *QueryService classes and assemble your criteria with the logic you need.

Resources