Original Message:
Sent: Fri March 10, 2023 12:02 PM
From: Steve Linn
Subject: Server variables
Thanks Filipe,
Well my ignorance on this topic is showing that I have minimal experience with OAI3 APIs as this doesn't exist for OAI2 APIs :-) This will be some new learning for me as well. I'll post back if I learn something new. Hopefully, someone else following this forum has some experience with OAI3 APIs and can help with your question.
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Fri March 10, 2023 09:56 AM
From: Filipe Ventura
Subject: Server variables
Hi Steve,
Thanks helping me.
I'm talking about this tab:
Regards
------------------------------
Filipe Ventura
Original Message:
Sent: Fri March 10, 2023 09:43 AM
From: Steve Linn
Subject: Server variables
Hi Filipe,
Definitions are used primarily for the validate and map policies. They define the schema of some message body. If you're importing a wsdl for a web service, these definitions are created automatically for you, but otherwise, you'll need to create them yourself. There is a helper tool where you can provide a sample JSON or XML document and the schema will be created for you. One caveat if you do have XML definitions is that the generation tool is not data type aware. For example,
<element>true</element>
is that value true a string "true" or a boolean true? The same would be for numeric values, so some modification on your part of the generated schema may be required. Finally if your XML has repeating elements allowed, you must specify repeating elements in your sample or the schema would specify it as a non-array. If repeating elements are encountered at the same XML hierarchy, the element is known to be an array.
From my experience, the map policy is more widely used than the validate policy. The definition can be referenced by the input and output sides of the mapping, which would then allow you to map an input property to an output property in the APIM UI.
As for "server variable", please explain where you're seeing that option. Perhaps my commentary above on "definitions" is not what you are talking about with "server definitions"?
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Fri March 10, 2023 04:58 AM
From: Filipe Ventura
Subject: Server variables
Hi everyone,
When defining an API we have a place to define server definitions.
One of the options are the server variables. Can someone explain me the benefits of using it and how to do it?
Regards.
------------------------------
Filipe Ventura
------------------------------