Sometimes response of a service is too large that swagger cannot get and beautify response as json.
if we try with "curl" command, we get response very fast. I think this is because of "Syntax highlighting" configuration of swagger.
In this url, we can understand that one way is change this config:
springdoc.swagger-ui.syntaxHighlight.activated=false
Do you have any idea in wso2 apim 4.1.0?
Can we change API Definition for this? or we have to change core configs of wso2?
With advanced UI customization you should be able to get this done. Please refer - https://apim.docs.wso2.com/en/latest/reference/customize-product/customizations/advanced-ui-customization/
You will have to customize the Swagger UI and add the springdoc.swagger-ui.syntaxHighlight.activated property there.
In[1], it is added springdoc.swagger-ui.validatorUrl for the Swagger UI.
[1] -
https://github.com/wso2/apim-apps/blob/main/portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/ApiConsole/SwaggerUI.jsx#L32
Related
I am trying to use APIs from this https://support.smartbear.com/zephyr-scale-server/api-docs/v1/ documentation, where I am Unable to get the response. I am fulfilling all the specified requirements as mentioned in above documentation.
http://{My_Jira_URL}/jira/rest/atm/1.0/testcase/{Test_Case_ID}/attachments
The Auth type which I am using is Basic.
Here is a response which I am getting in postman
Can anyone let me know what I am doing wrong | what could be the cause behind this issue.
Or Else any alternate way or API resources to get Attachments for Jira-Zephyer Test cases?
You will need to use Zephyr scale API token as authorization to get a response for the APIs.
https://support.smartbear.com/zephyr-scale-cloud/api-docs/#section/Authentication
currently i am using API Manager 4.0
If there is a content-lengh header in the Post Method, how can I set it up and test the API in the "try out" tab? I need help.
method: POST
url: http://apihostip/GetPut?TYPE=GET&CLA=STRK
content:
:HEADER
TABLE=VERSION
VERSION
STRING
1.00
TABLE=VALID_OPER
SERIAL_NUM
STRING
ABCDEDF
But when try it out, come out the 411 error
Thanks.
From the API Publisher you can add a header to the resource.
Go to the API and click API Configurations under Develop section.
Click on the Resources.
Go the resource and add parameters.
From the parameters, click the Header type and fill the rest.
Deploy the API.
When you are trying out the API from the Swagger UI, it shows the header and you can provide any value to that header.
I am working on a C#/.Net serverless application using the AWS Visual Studio Toolkit, and I am having a bit of trouble figuring out what I am missing as far as CORS configuration. I based my project off of the ASP.Net example included with the toolkit, which configured API Gateway to have a single API endpoint that works as a proxy into the ASP.Net Web API framework.
In testing this application in chrome (serving a local node project) I am getting No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
I know this means I have to configure CORS on the API Gateway endpoint, but I seem to be missing something. I use the actions dropdown to enable CORS as such...
But I get some errors and the problem persists.
I used a chrome extension to disable CORS (temporarily) and have confirmed that the API endpoint works normally without CORS.
So what am I missing here? The examples of setting CORS online don't usually have instructions of a catch-all endpoint like this is set up to use, and even breaking GET into its own method didn't seem to help.
As an additional question, if there is some CORS configuration I am missing, is there a good way to get it integrated into the serverless.template file or some other automated deploy step?
It has to do with your ANY proxy method. As stated here: http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html
Note
When applying the above instructions to the ANY method in a proxy integration, any applicable CORS headers will not be set. Instead, you rely on the integration back end to return the applicable CORS headers, such as Access-Control-Allow-Origin
So you will have to make your backend API return the appropriate CORS headers.
You need to have the header on your server as well as the api gateway.
See this sample: - The cors header is applied to the static bucket website
https://www.codeproject.com/Articles/1178781/Serverless-Architecture-using-Csharp-and-AWS-Amazo
For the APIs to work properly two things must be done:
1. The options method must be correctly setup - usually done using a mock method on the API gateway.
2. The HTTP method implementations in your code must return the CORS header correctly. There are quite a few articles about this if you search.
For me the problem was Point 1; using the API Gateway 'Enable CORS' button did not work for me when I was developing API-Gateway Lambda integration using .NET Core. I also didn't find a way to add creation of the options method in the serverless.template file.
Here's another way to do it; after publishing the lambdas from CLI or VisualStudio, fire a PUT request on the API endpoint and pass a swagger definition which contains the options method defs and ensure you set the query param mode=merge. You can use PostMan to do this.
or
You use a DotNet utility which does the same thing explained here:
http://sbytestream.pythonanywhere.com/blog/Enabling-APIGateway-CORS
The source code is available on GitHub too.
I am using APIM 1.10 to add new APIs via the REST-API (see: https://docs.wso2.com/display/AM1100/apidocs/publisher/#!/operations#APIsApi#apisPost) and it works fine but:
I want to add the security-scheme: "Basic Auth" for the api endpoint.
But I have no idea how to do this, because the endpointConfig-config is not described.
I need something like this: endpointSecured:true, endpointAuthDigest:"Basic", endpointUTUsername:"usN", endpointUTPassword:"pass"
Any ideas?
C ya,
Marty
Following steps will help you to achieve the requirement.
Edit the API and go to the implementation tab.
Click on "Show More Options".
Select "Secured" for Endpoint Security Scheme.
Provide the credentials and save.
When you create API using rest API, you can add secure endpoint details by adding following part. &endpointType=secured&epUsername="admin"& epPassword="admin"
Here is a sample command
curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d "action=addAPI&name=SampleAPI&context=/country&version=1.0.0&visibility=public&thumbUrl=&description=Check Country by Code&tags=country&endpointType=secured&epUsername="admin"& epPassword="admin"&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https&resourceCount=0&resourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited&uriTemplate-0=/*&default_version_checked=default_version&bizOwner=xx&bizOwnerMail=xx#ee.com&techOwner=xx&techOwnerMail=ggg#ww.com" -d'endpoint_config={"production_endpoints":{"url":"http://services.groupkt.com/country/get/iso2code/IN","config":null},"endpoint_type":"http"}';
I wish to update the proxy generated default Url. I have followed How to change WSO2 ESB URL but the solution provided there was not working and even i wish to block generating two urls for soap bindings depending on version.
Any help please
You have to redirect to the default URL from the main sequence of the ESB. Following article explains the configurations
http://achala11.blogspot.com/2012/08/access-wsdl-for-customuri-wso2-esb.html