Skip to content
New issue

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

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

Already on GitHub? # to your account

MVCSwagResponses isArray bug #376

Closed
st1gok opened this issue May 2, 2020 · 4 comments
Closed

MVCSwagResponses isArray bug #376

st1gok opened this issue May 2, 2020 · 4 comments

Comments

@st1gok
Copy link

st1gok commented May 2, 2020

Hi!
I`m used RC5.
If set first method MVCSwagResponses isArray=true then all methods next following him also return array, even if they set isArray=false.

And otherwise if first method MVCSwagResponses isArray=false then all next methods also return not array.

Example:

[MVCPath('/profiles')]
[MVCSwagSummary('Profile', 'List all profiles', 'getProfiles')]
[MVCSwagResponses(200, 'Success', TProfile, True)]
[MVCSwagResponses(500, 'Internal Server Error')]
[MVCHTTPMethod([httpGET])]
procedure GetProfiles;

[MVCPath('/profiles/($uid)/activation')]
[MVCHTTPMethod([httpPOST])]
[MVCSwagParam(plPath, 'uid', 'profile id', ptInteger)]
[MVCSwagResponses(200, 'Success', TProfile)]
[MVCSwagResponses(500, 'Internal Server Error')]
[MVCSwagSummary('Profile', 'activate profile from device', 'activateProfiles')]
procedure Activation(uid: String);

[MVCPath('/profiles')]
[MVCSwagParam(plBody, 'entity', 'Profile object', TProfile)]
[MVCSwagSummary('Profile', 'Create or update profile', 'createProfile')]
[MVCSwagResponses(201, 'Success', TProfile)]
[MVCSwagResponses(500, 'Internal Server Error')]
[MVCHTTPMethod([httpPOST])]
procedure CreateProfile();
@danieleteti
Copy link
Owner

Does this happend also in the latest RC?

@st1gok
Copy link
Author

st1gok commented May 2, 2020

In RC6 same behavior. In result swagger.json is being created next Model:

"definitions": {
"Profile": {
"type": "array",
"items": {
"type": "object",
"required": [
"uid",
"carId"
],
"properties": {
"uid": {
"type": "string",
"description": "profile id"
},
"carId": {
"type": "string",
"description": "car id in navigation system"
},
"date": {
"type": "integer",
"description": "date in timestanp"
},
"token": {
"type": "string",
"description": "fcm token"
}
}
}
}
}

And all methods ref to her

@danieleteti
Copy link
Owner

OK, thank you. We'll look at this.

@joaoduarte19
Copy link
Collaborator

I identified the cause of this error. I'm already working on it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants