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

Document StateEvent for /createRoom #1329

Merged
merged 3 commits into from Jun 22, 2018

Conversation

Projects
None yet
3 participants
@Half-Shot
Contributor

Half-Shot commented Jun 22, 2018

I mostly copied and pasted from https://matrix.org/docs/spec/client_server/r0.3.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey but obviously changed it where needed. I also tidied up the English to read better e.g. "Defaults to the empty string" => "Defaults to an empty string"

Fixes #1327

state_key:
type: string
description: The state_key of the state event. Defaults to an empty string.

This comment has been minimized.

@richvdh

richvdh Jun 22, 2018

Member

is this not a requried attribute, and therefore has no default?

This comment has been minimized.

@Half-Shot

Half-Shot Jun 22, 2018

Contributor

I can't see why it would be? State events aren't required to have keys. I can stick an Optional on the front

This comment has been minimized.

@richvdh

richvdh Jun 22, 2018

Member

the very thing that makes it be a state event is that it has a (possibly empty) key. Personally I would rather we were explicit about that.

worth checking what synapse currently requires imho

This comment has been minimized.

@Half-Shot

Half-Shot Jun 22, 2018

Contributor

I did :). Synapse defaults it to ""

This comment has been minimized.

@Half-Shot

Half-Shot Jun 22, 2018

Contributor
        raw_initial_state = config.get("initial_state", [])

        initial_state = OrderedDict()
        for val in raw_initial_state:
            initial_state[(val["type"], val.get("state_key", ""))] = val["content"]

This comment has been minimized.

@richvdh

richvdh Jun 22, 2018

Member

UGH FINE THEN. still, type and content are required.

@richvdh

probably worth adding a required key here to say that (all three?) keys are required.

@Half-Shot

This comment has been minimized.

Contributor

Half-Shot commented Jun 22, 2018

I think that's all?

@Half-Shot Half-Shot force-pushed the Half-Shot:hs/document-createroom-state branch from d108a5a to 03915c7 Jun 22, 2018

@richvdh

also, any chance of a note for the changelog?

state_key:
type: string
description: Optional. The state_key of the state event. Defaults to an empty string.

This comment has been minimized.

@richvdh

richvdh Jun 22, 2018

Member

well it's pretty obvious that it's optional now that the others say "Required" next to them...

@richvdh richvdh assigned Half-Shot and unassigned richvdh Jun 22, 2018

@Half-Shot Half-Shot force-pushed the Half-Shot:hs/document-createroom-state branch from 03915c7 to 01f988c Jun 22, 2018

@Half-Shot Half-Shot assigned richvdh and unassigned Half-Shot Jun 22, 2018

@turt2live

Looks good to me. Thanks for documenting it!

@richvdh

This comment has been minimized.

Member

richvdh commented Jun 22, 2018

thanks!

@richvdh richvdh merged commit 1140c0c into matrix-org:master Jun 22, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment