Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong extracted doc-string #75

Open
josephbirkner opened this issue Feb 4, 2022 · 1 comment
Open

Wrong extracted doc-string #75

josephbirkner opened this issue Feb 4, 2022 · 1 comment
Assignees
Labels
Bug 🐛 Something isn't working

Comments

@josephbirkner
Copy link
Collaborator

In the case of multiple services sharing a similar method name, it is possible that zswag.gen associates the docstring of methodA in one service with the doc string of methodA in another service.

@josephbirkner josephbirkner added the Bug 🐛 Something isn't working label Feb 4, 2022
@josephbirkner josephbirkner self-assigned this Feb 4, 2022
@josephbirkner josephbirkner changed the title Wring extracted doc-string Wrong extracted doc-string Feb 4, 2022
@kancve
Copy link

kancve commented Sep 20, 2023

I have also encountered this problem.

root@27999e3863c9:/code/myapp# cat services.zs
package services;

struct Request {
int32 value;
};

struct Response {
int32 value;
};

service TomService {
/** I am Tom's API. */
Response myApi(Request);
};

service AliceService {
/** I am Alice's API. */
Response myApi(Request);
};
root@27999e3863c9:/code/myapp# python3 -m zswag.gen -s services.TomService -i services.zs -o api.yaml
[INFO] Auto-generating path for zswag_gen_1c7fc182577411eeb16b0242ac110002.services.TomService.myApi.
[INFO] Validating with openapi-spec-validator ... OK
[INFO] Writing to 'api.yaml' ... OK
[INFO] Validating with zswag parser ... OK
[INFO] Done.
root@27999e3863c9:/code/myapp# cat api.yaml
info:
contact:
email: [email protected]
description: REST API for services.TomService service.
license:
name: TODO
title: services.TomService
version: TODO
openapi: 3.0.0
paths:
/myApi:
post:
description: 'I am Alice''s API. '
operationId: myApi
parameters: []
requestBody:
content:
application/x-zserio-object:
schema:
type: string
description: '### struct Request'
responses:
'200':
content:
application/x-zserio-object:
schema:
format: binary
type: string
description: '### struct Response'
summary: 'I am Alice''s API. '
servers: []
root@27999e3863c9:/code/myapp#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants