When a service is implemented via the HTTP service contract type, none of the HTTP annotations are allowed in the service implementation. For consistency, this should be applied for the OpenAPI annotations as well.
Steps to Reproduce
The following should not be allowed:
// UsersService is a service contract type
service UsersService on new http:Listener(9090) {
// This should not be allowed
@openapi:ResourceInfo {
summary: "This is a resource function which can be used to get the path"
}
resource function post users/[string id]("approved"|"pending"|"closed"|"new" status, User user) returns User {
return user;
}
}
Description
When a service is implemented via the HTTP service contract type, none of the HTTP annotations are allowed in the service implementation. For consistency, this should be applied for the OpenAPI annotations as well.
Steps to Reproduce
The following should not be allowed:
Version
Ballerina SwanLake Update 10(2201.10.0)
Environment Details (with versions)
No response