SWIM Supporting Material
SWIM-SERV-340 Examples of code
Requirement
Title | Examples of code |
Identifier | SWIM-SERV-340 |
Requirement | A service description should include or refer to examples of code exemplifying the implementation of the consuming service interface. |
Rationale | Providing example code is a best practice to speed up prototyping. |
Verification | Completeness: Not Applicable. Consistency: If provided, verify that the provided examples correspond to the described service. Correctness: Not Applicable. |
Examples/Notes | Examples include source code in a given programming language, input and output messages. |
Level of Implementation | Recommended |
Guidance
Verification Support
Consistency | Check that: [ ] The provided examples correspond to the described service. |
Examples
The following example shows the content as a table.
examples of code | public:/2019-09/MessageExamples.txt |
|---|
The following example shows an extract of the content of a JSON file that conforms to the Service Metadata Schema
Example of SWIM-SERV-340 using Service Metadata Schema
"references": {
"serviceDocument": [{
"documentType": "CODE_EXAMPLE",
"title": "Example of messages",
"version": "1.0",
"description": "A set of message examples",
"reference": {
"url": "public:/2019-09/MessageExamples.txt"
}
},
{
"documentType": "CODE_EXAMPLE",
"title": "Service Implementation Manual",
"version": "24.0",
"description": "The manual to be used by service consumers when implementing the service. It includes code examples.",
"reference": {
"url": "public:/2019-09/ServiceImplementationManual.html"
}
}]
}Complete examples are available at Example service description.