this code:
MyEnum = (enum1, enum2, enum3);
..
[ROServiceMethod]
[ROCustom('HttpApiPath','test')]
[ROCustom('HttpApiMethod','PUT')]
function Dotest(searchname : string) : MyEnum;
end;
generates
{"swagger":"2.0","info":{"title":"NewProjectLibrary","version":"1.0.0"},"host":"localhost:8099","basePath":"\/api","schemes":["http"],"consumes":["application\/json"],"produces":["application\/json"],"paths":{"\/test":{"put":{"parameters":[{"name":"NewProjectServiceDotestRequest","in":"body","schema":{"$ref":"#\/definitions\/NewProjectServiceDotestRequest"}}],"responses":{"200":{"description":"The method call completed successfully","schema":{"$ref":"#\/definitions\/MyEnum"}},"400":{"description":"Bad Request"},"500":{"description":"Internal Server Error"}}}}},"definitions":{"NewProjectServiceDotestRequest":{"type":"object","properties":{"searchname":{"type":"string"}}},"MyEnum":{"type":"string","enum":["enum1","enum2","enum3"]}}}
and editor has no issue with it:
Iāve tested it:
[ROServiceMethod]
[ROCustom('HttpApiPath','admin/user/{username}')]
[ROCustom('HttpApiMethod','DELETE')]
function DeleteUser(username : string): string;
[ROServiceMethod]
[ROCustom('HttpApiPath','admin/user/{username}')]
[ROCustom('HttpApiMethod','PUT')]
function DeleteUser2(username : string): string;
...
function TNewProjectService.DeleteUser(username: string): string;
begin
Result := 'DELETE: '+username;
end;
function TNewProjectService.DeleteUser2(username: string): string;
begin
Result := 'PUT: '+username;
end;
C:\>curl -v -X PUT "http://localhost:8099/api/admin/user/aaa" -H "accept: application/json"
* Trying ::1:8099...
* Trying 127.0.0.1:8099...
* Connected to localhost (127.0.0.1) port 8099 (#0)
> PUT /api/admin/user/aaa HTTP/1.1
> Host: localhost:8099
> User-Agent: curl/7.72.0
> accept: application/json
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Connection: close
< Content-Type: application/json; charset=utf-8
< Content-Length: 11
< Date: Thu, 18 Aug 2022 13:15:23 GMT
< Accept-Encoding: gzip, identity
<
"PUT: aaa"* Closing connection 0
C:\>curl -v -X DELETE "http://localhost:8099/api/admin/user/aaa" -H "accept: application/json"
* Trying ::1:8099...
* Trying 127.0.0.1:8099...
* Connected to localhost (127.0.0.1) port 8099 (#0)
> DELETE /api/admin/user/aaa HTTP/1.1
> Host: localhost:8099
> User-Agent: curl/7.72.0
> accept: application/json
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Connection: close
< Content-Type: application/json; charset=utf-8
< Content-Length: 14
< Date: Thu, 18 Aug 2022 13:15:26 GMT
< Accept-Encoding: gzip, identity
<
"DELETE: aaa"
* Closing connection 0