Fixed issues with schema name collisions by mlubimow · Pull Request #5486 · encode/django-rest-framework (original) (raw)

@carltongibson I optimized my solution a bit.

So the issue was that nodes in paths tree could be either OrderedDict or Link - which was causing issue in two cases:

  1. Node is both link and subpath of another link
  2. Multiple links were assinged to node

So what I've done, I've made every node in a tree a LinkNode (ordered dict with links array). So each node now can be both a link and a subpath. Also, because I've got array of links, now we can have multiple links in same node (same path said in other way).

How it affects the schema? It doesnt use retrieve , read etc as keys now, its just get_0, get_1, post_0 and so on. How it affect docs? I've checked swagger only because this is what Im working with and it works fine, for other UIs - I dont know.