Set the default service version for OpenAPI documentation
Define which version of a service is shown by default in the OpenAPI documentation.
You can define a default version for an entire web service. The default version determines which versions of the operations appear in the OpenAPI documentation when no specific version is requested.
The default version is set in the service information record using the WSVersion (module) attribute.
This setting applies to the entire web service.
OpenAPI
Setting a default version is optional. However, if no default version is defined and the client
does not specify a version in the query string, the request returns a 404 (Not
found) and the server raises error
41 internally.
- operations whose WSVersion value matches the version name you set at the module level, and
- operations that are unversioned or use
WSVersion="default".
WSVersion="default".
This is useful when introducing versioning in the first release of a service; for example, setting
WSVersion="v1" even though none of the operations are versioned yet. It helps users
understand that versioning is supported and prepares them for future changes.Default OpenAPI version
WSVersion is set to "v3". This makes v3 the default version
used when generating the OpenAPI documentation for the web service. When you use WSVersion at the module level, you can only assign a
single version, and the value cannot be "default". Multiple versions or using
WSVersion="default" are only allowed at the function level. If either is detected
at the module level, the compiler reports error error-9140.
PUBLIC DEFINE myInfo RECORD ATTRIBUTES(WSInfo, WSVersion = "v3")
title STRING
# ...
END RECORD