Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Help Wanted: User props is not fully described in API reference #643

Open
vblz opened this issue Jun 4, 2021 · 7 comments
Open

Help Wanted: User props is not fully described in API reference #643

vblz opened this issue Jun 4, 2021 · 7 comments
Labels
Help Wanted Community help wanted

Comments

@vblz
Copy link

vblz commented Jun 4, 2021

Everywhere in the API reference User Props is described as object. For instance https://api.mattermost.com/#operation/CreateUser .
Regarding to https://www.json.org/json-en.html JSON object can have members of any JSON types.

But in official drivers the field props has type map[string]string
https://github.com/mattermost/mattermost-server/blob/d1eeafb29ff822cf6d9850a5307ab37c61fbc445/model/user.go#L85
https://github.com/mattermost/mattermost-redux/blob/3d1028034d7677adfda58e91b9a5dcaf1bc0ff99/src/types/users.ts#L42

Proposal:
In the API reference clearly specify that User Props can have members only of string type

@cwarnermm
Copy link
Member

@mkraft - Would a member of your team be able to assist with this issue?

@mkraft
Copy link
Contributor

mkraft commented Mar 8, 2022

@vblz The word "object" is actually correct in this case in that the required type is an object, an object that happens to have other constraints. Also the constraints are detailed within the API documentation.

Screen Shot 2022-03-08 at 4 56 11 PM

.

@mkraft mkraft closed this as completed Mar 8, 2022
@vblz
Copy link
Author

vblz commented Mar 9, 2022

@mkraft I didn't mean whole object to pass, but only props field.
image
According to the code I linked above you can not pass such a valid JSON object there

...
 "props": {"a": 1, "b":["list", "example"]}
 ...

but there is no mention about this limitation in api documentation and only way to find it out is checking source code.

@mkraft mkraft reopened this Mar 9, 2022
@mkraft
Copy link
Contributor

mkraft commented Mar 9, 2022

@vblz Ah yes good point, props isn't well documented like notify_props is. Is this something you would be interested in submitting a pull request for? If not, no worries we can add it as a help wanted. Either way, thanks for identifying it.

@vblz
Copy link
Author

vblz commented Mar 10, 2022

@mkraft it's better to add "help wanted" tag

@cwarnermm cwarnermm changed the title User props is not fully described in API reference Help Wanted: User props is not fully described in API reference Mar 10, 2022
@cwarnermm cwarnermm added Help Wanted Community help wanted and removed acknowledged/docs labels Mar 10, 2022
@mkraft
Copy link
Contributor

mkraft commented Mar 10, 2022

Copied the request to https://mattermost.atlassian.net/browse/MM-42462.

@1kjnv
Copy link

1kjnv commented Aug 24, 2022

I would like to work on this. @mkraft @cwarnermm Can you assign this to me?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted Community help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants