twskj / pretty-swag

Pretty UI for Swagger spec
MIT License
122 stars 20 forks source link

Consider `filterByTag` requiring all listed tags instead of any #51

Closed Maaartinus closed 5 years ago

Maaartinus commented 6 years ago

filterByTag computes the union of all apis rather than an intersection. In my case, this is pretty useless, as each of my "apis" have quite a few tags and any union shows a lot entries.

An intersection would be much better as my "apis" are classified according to three criteria into disjoint groups and using two tags in conjunction would allow finding the wanted "api" rather immediately.

The implementation is not the problem, the questions are:

twskj commented 6 years ago

You can exclude tags by using - prefix. For example, if we want all customer but not with DELETE method, we would type customer -DELETE

Is this something you are looking for?

twskj commented 6 years ago

Come to think about it, intersection has its place too. Maybe we could have a flag that can choose between OR or AND

twskj commented 6 years ago

I decided to do "doubleQuote" instead of + The behavior will be

Maaartinus commented 6 years ago

I proposed + because it's what Google search did some long time ago, but I can live with double quote equally well. :laughing: I'm glad about it being the new default.

twskj commented 6 years ago

I have the search functionality in place. I'll polish it a bit before checking with you :-)

twskj commented 6 years ago

Rolled out! Check it out and let me know.

Maaartinus commented 6 years ago

You've also changes the search to require the full quoted tag, which is much better for me, as I have quite a few tags like XYZ and XYZ_ITEM. Fantastic!

The possibility to remove a tag by clicking is nice, too!

twskj commented 6 years ago

Just to sum it up for my future reference

The behavior of the filtering is as follow:

Maaartinus commented 6 years ago

There's one more thing.... the list shows really the available tags only, i.e., it changes all the time, which makes it much less practical. Always showing the full list and disabling the unavailable tags would be IMHO much better. Do you like the idea?

If so, then the styling should be so that disabling a tag does not change it's width; otherwise, the following would would move, which is ugly.

twskj commented 6 years ago

hmm I like your idea actually. Since now we color them blue, we can easily grey them instead of removing 🤔

Can you justify further or give some use cases why is it much better?

Maaartinus commented 6 years ago

Assuming, the tag list is not too huge (my tags are just two lines as I'm using "autoTags": false), it's much better.

twskj commented 5 years ago

previously added