@@ -742,3 +742,199 @@ test('test overrides', () => {
742742 } ,
743743 ] ) ;
744744} ) ;
745+
746+ test ( 'multiple tags' , ( ) => {
747+ const paths = {
748+ '/api/entities' : {
749+ get : {
750+ operationId : 'EntityController_list' ,
751+ summary : 'List all entities' ,
752+ parameters : [
753+ {
754+ name : 'all' ,
755+ required : false ,
756+ in : 'query' ,
757+ example : false ,
758+ description : 'Boolean flag description' ,
759+ schema : {
760+ type : 'boolean' ,
761+ } ,
762+ } ,
763+ ] ,
764+ tags : [
765+ '🖥️ Entity' ,
766+ "Another Tag"
767+ ] ,
768+ } ,
769+ } ,
770+ } ;
771+
772+ const parser = new N8NPropertiesBuilder ( { paths} ) ;
773+ const result = parser . build ( )
774+
775+ expect ( result ) . toEqual (
776+ [
777+ {
778+ "default" : "" ,
779+ "displayName" : "Resource" ,
780+ "name" : "resource" ,
781+ "noDataExpression" : true ,
782+ "options" : [
783+ {
784+ "description" : "" ,
785+ "name" : "🖥️ Entity" ,
786+ "value" : "Entity"
787+ } ,
788+ {
789+ "description" : "" ,
790+ "name" : "Another Tag" ,
791+ "value" : "Another Tag"
792+ }
793+ ] ,
794+ "type" : "options"
795+ } ,
796+ {
797+ "default" : "" ,
798+ "displayName" : "Operation" ,
799+ "displayOptions" : {
800+ "show" : {
801+ "resource" : [
802+ "Entity"
803+ ]
804+ }
805+ } ,
806+ "name" : "operation" ,
807+ "noDataExpression" : true ,
808+ "options" : [
809+ {
810+ "action" : "List all entities" ,
811+ "description" : "List all entities" ,
812+ "name" : "List" ,
813+ "routing" : {
814+ "request" : {
815+ "method" : "GET" ,
816+ "url" : "=/api/entities"
817+ }
818+ } ,
819+ "value" : "List"
820+ }
821+ ] ,
822+ "type" : "options"
823+ } ,
824+ {
825+ "default" : "" ,
826+ "displayName" : "Operation" ,
827+ "displayOptions" : {
828+ "show" : {
829+ "resource" : [
830+ "Another Tag"
831+ ]
832+ }
833+ } ,
834+ "name" : "operation" ,
835+ "noDataExpression" : true ,
836+ "options" : [
837+ {
838+ "action" : "List all entities" ,
839+ "description" : "List all entities" ,
840+ "name" : "List" ,
841+ "routing" : {
842+ "request" : {
843+ "method" : "GET" ,
844+ "url" : "=/api/entities"
845+ }
846+ } ,
847+ "value" : "List"
848+ }
849+ ] ,
850+ "type" : "options"
851+ } ,
852+ {
853+ "default" : "" ,
854+ "displayName" : "GET /api/entities" ,
855+ "displayOptions" : {
856+ "show" : {
857+ "operation" : [
858+ "List"
859+ ] ,
860+ "resource" : [
861+ "Entity"
862+ ]
863+ }
864+ } ,
865+ "name" : "operation" ,
866+ "type" : "notice" ,
867+ "typeOptions" : {
868+ "theme" : "info"
869+ }
870+ } ,
871+ {
872+ "default" : false ,
873+ "description" : "Boolean flag description" ,
874+ "displayName" : "All" ,
875+ "displayOptions" : {
876+ "show" : {
877+ "operation" : [
878+ "List"
879+ ] ,
880+ "resource" : [
881+ "Entity"
882+ ]
883+ }
884+ } ,
885+ "name" : "all" ,
886+ "routing" : {
887+ "request" : {
888+ "qs" : {
889+ "all" : "={{ $value }}"
890+ }
891+ }
892+ } ,
893+ "type" : "boolean"
894+ } ,
895+ {
896+ "default" : "" ,
897+ "displayName" : "GET /api/entities" ,
898+ "displayOptions" : {
899+ "show" : {
900+ "operation" : [
901+ "List"
902+ ] ,
903+ "resource" : [
904+ "Another Tag"
905+ ]
906+ }
907+ } ,
908+ "name" : "operation" ,
909+ "type" : "notice" ,
910+ "typeOptions" : {
911+ "theme" : "info"
912+ }
913+ } ,
914+ {
915+ "default" : false ,
916+ "description" : "Boolean flag description" ,
917+ "displayName" : "All" ,
918+ "displayOptions" : {
919+ "show" : {
920+ "operation" : [
921+ "List"
922+ ] ,
923+ "resource" : [
924+ "Another Tag"
925+ ]
926+ }
927+ } ,
928+ "name" : "all" ,
929+ "routing" : {
930+ "request" : {
931+ "qs" : {
932+ "all" : "={{ $value }}"
933+ }
934+ }
935+ } ,
936+ "type" : "boolean"
937+ }
938+ ]
939+ ) ;
940+ } ) ;
0 commit comments