| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612 |
- // Licensed to the .NET Foundation under one or more agreements.
- // The .NET Foundation licenses this file to you under the MIT license.
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Routing.Constraints;
- using Microsoft.AspNetCore.Routing.Patterns;
- using Microsoft.AspNetCore.Routing.TestObjects;
- using Microsoft.Extensions.DependencyInjection;
- using Microsoft.Extensions.Logging.Abstractions;
- using Microsoft.Extensions.Options;
- using Moq;
- namespace Microsoft.AspNetCore.Routing.Matching;
- public class DfaMatcherBuilderTest
- {
- [Fact]
- public void BuildDfaTree_SingleEndpoint_Empty()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint("/");
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Same(endpoint, Assert.Single(root.Matches));
- Assert.Null(root.Parameters);
- Assert.Null(root.Literals);
- }
- [Fact]
- public void BuildDfaTree_SingleEndpoint_Literals()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint("a/b/c");
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Null(a.Matches);
- Assert.Null(a.Parameters);
- next = Assert.Single(a.Literals);
- Assert.Equal("b", next.Key);
- var b = next.Value;
- Assert.Null(b.Matches);
- Assert.Null(b.Parameters);
- next = Assert.Single(b.Literals);
- Assert.Equal("c", next.Key);
- var c = next.Value;
- Assert.Same(endpoint, Assert.Single(c.Matches));
- Assert.Null(c.Parameters);
- Assert.Null(c.Literals);
- }
- [Fact]
- public void BuildDfaTree_SingleEndpoint_Parameters()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint("{a}/{b}/{c}");
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Literals);
- var a = root.Parameters;
- Assert.Null(a.Matches);
- Assert.Null(a.Literals);
- var b = a.Parameters;
- Assert.Null(b.Matches);
- Assert.Null(b.Literals);
- var c = b.Parameters;
- Assert.Same(endpoint, Assert.Single(c.Matches));
- Assert.Null(c.Parameters);
- Assert.Null(c.Literals);
- }
- [Fact]
- public void BuildDfaTree_SingleEndpoint_CatchAll()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint("{a}/{*b}");
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Literals);
- var a = root.Parameters;
- // The catch all can match a path like '/a'
- Assert.Same(endpoint, Assert.Single(a.Matches));
- Assert.Null(a.Literals);
- Assert.Null(a.Parameters);
- // Catch-all nodes include an extra transition that loops to process
- // extra segments.
- var catchAll = a.CatchAll;
- Assert.Same(endpoint, Assert.Single(catchAll.Matches));
- Assert.Null(catchAll.Literals);
- Assert.Same(catchAll, catchAll.Parameters);
- Assert.Same(catchAll, catchAll.CatchAll);
- }
- [Fact]
- public void BuildDfaTree_SingleEndpoint_CatchAllAtRoot()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint("{*a}");
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Same(endpoint, Assert.Single(root.Matches));
- Assert.Null(root.Literals);
- // Catch-all nodes include an extra transition that loops to process
- // extra segments.
- var catchAll = root.CatchAll;
- Assert.Same(endpoint, Assert.Single(catchAll.Matches));
- Assert.Null(catchAll.Literals);
- Assert.Same(catchAll, catchAll.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_LiteralAndLiteral()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/b1/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/b2/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Null(a.Matches);
- Assert.Equal(2, a.Literals.Count);
- var b1 = a.Literals["b1"];
- Assert.Null(b1.Matches);
- Assert.Null(b1.Parameters);
- next = Assert.Single(b1.Literals);
- Assert.Equal("c", next.Key);
- var c1 = next.Value;
- Assert.Same(endpoint1, Assert.Single(c1.Matches));
- Assert.Null(c1.Parameters);
- Assert.Null(c1.Literals);
- var b2 = a.Literals["b2"];
- Assert.Null(b2.Matches);
- Assert.Null(b2.Parameters);
- next = Assert.Single(b2.Literals);
- Assert.Equal("c", next.Key);
- var c2 = next.Value;
- Assert.Same(endpoint2, Assert.Single(c2.Matches));
- Assert.Null(c2.Parameters);
- Assert.Null(c2.Literals);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_LiteralDifferentCase()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/b1/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("A/b2/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Null(a.Matches);
- Assert.Equal(2, a.Literals.Count);
- var b1 = a.Literals["b1"];
- Assert.Null(b1.Matches);
- Assert.Null(b1.Parameters);
- next = Assert.Single(b1.Literals);
- Assert.Equal("c", next.Key);
- var c1 = next.Value;
- Assert.Same(endpoint1, Assert.Single(c1.Matches));
- Assert.Null(c1.Parameters);
- Assert.Null(c1.Literals);
- var b2 = a.Literals["b2"];
- Assert.Null(b2.Matches);
- Assert.Null(b2.Parameters);
- next = Assert.Single(b2.Literals);
- Assert.Equal("c", next.Key);
- var c2 = next.Value;
- Assert.Same(endpoint2, Assert.Single(c2.Matches));
- Assert.Null(c2.Parameters);
- Assert.Null(c2.Literals);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_LiteralAndParameter()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/b/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/{b}/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Null(a.Matches);
- next = Assert.Single(a.Literals);
- Assert.Equal("b", next.Key);
- var b = next.Value;
- Assert.Null(b.Matches);
- Assert.Null(b.Parameters);
- next = Assert.Single(b.Literals);
- Assert.Equal("c", next.Key);
- var c1 = next.Value;
- Assert.Collection(
- c1.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(c1.Parameters);
- Assert.Null(c1.Literals);
- var b2 = a.Parameters;
- Assert.Null(b2.Matches);
- Assert.Null(b2.Parameters);
- next = Assert.Single(b2.Literals);
- Assert.Equal("c", next.Key);
- var c2 = next.Value;
- Assert.Same(endpoint2, Assert.Single(c2.Matches));
- Assert.Null(c2.Parameters);
- Assert.Null(c2.Literals);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ParameterAndParameter()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/{b1}/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/{b2}/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Null(a.Matches);
- Assert.Null(a.Literals);
- var b = a.Parameters;
- Assert.Null(b.Matches);
- Assert.Null(b.Parameters);
- next = Assert.Single(b.Literals);
- Assert.Equal("c", next.Key);
- var c = next.Value;
- Assert.Collection(
- c.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(c.Parameters);
- Assert.Null(c.Literals);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_LiteralAndCatchAll()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/b/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/{*b}");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Same(endpoint2, Assert.Single(a.Matches));
- next = Assert.Single(a.Literals);
- Assert.Equal("b", next.Key);
- var b1 = next.Value;
- Assert.Same(endpoint2, Assert.Single(a.Matches));
- Assert.Null(b1.Parameters);
- next = Assert.Single(b1.Literals);
- Assert.Equal("c", next.Key);
- var c1 = next.Value;
- Assert.Collection(
- c1.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(c1.Parameters);
- Assert.Null(c1.Literals);
- var catchAll = a.CatchAll;
- Assert.Same(endpoint2, Assert.Single(catchAll.Matches));
- Assert.Same(catchAll, catchAll.Parameters);
- Assert.Same(catchAll, catchAll.CatchAll);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ParameterAndCatchAll()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/{b}/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/{*b}");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Same(endpoint2, Assert.Single(a.Matches));
- Assert.Null(a.Literals);
- var b1 = a.Parameters;
- Assert.Same(endpoint2, Assert.Single(a.Matches));
- Assert.Null(b1.Parameters);
- next = Assert.Single(b1.Literals);
- Assert.Equal("c", next.Key);
- var c1 = next.Value;
- Assert.Collection(
- c1.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(c1.Parameters);
- Assert.Null(c1.Literals);
- var catchAll = a.CatchAll;
- Assert.Same(endpoint2, Assert.Single(catchAll.Matches));
- Assert.Same(catchAll, catchAll.Parameters);
- Assert.Same(catchAll, catchAll.CatchAll);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ConstrainedParameterTrimming_DoesNotMeetConstraint()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("{a:length(2)}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("a", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- var cNodeKvp = Assert.Single(aNodeValue.Literals);
- Assert.Equal("c", cNodeKvp.Key);
- var cNode = cNodeKvp.Value;
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- var bNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bNodeKvp.Key);
- var bNode = bNodeKvp.Value;
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Theory]
- [InlineData("aa/c", "aa", "c")]
- [InlineData("1/c", "1", "c")]
- public void BuildDfaTree_MultipleEndpoint_ConstrainedParameterTrimming_EvaluatesAllConstraints(string candidate, string firstSegment, string secondSegment)
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint(candidate);
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("{a:int:length(2)}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal(firstSegment, aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- var cNodeKvp = Assert.Single(aNodeValue.Literals);
- Assert.Equal(secondSegment, cNodeKvp.Key);
- var cNode = cNodeKvp.Value;
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- var bNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bNodeKvp.Key);
- var bNode = bNodeKvp.Value;
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ConstrainedParameterTrimming_MeetsConstraint()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("aa/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("{a:length(2)}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- // Branch aa -> c = (aa/c)
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("aa", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- Assert.True(aNodeValue.Literals.TryGetValue("c", out var cNode));
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch (aa) -> b -> c = ({a:length(2)}/b/c)
- Assert.True(aNodeValue.Literals.TryGetValue("b", out var bNode));
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramBCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramBCNodeKvp.Key);
- var paramBCNode = paramBCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramBCNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch {param} -> b -> c = ({a:length(2)}/b/c)
- var bParamNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bParamNodeKvp.Key);
- var bParamNode = bParamNodeKvp.Value;
- Assert.Null(bParamNode.Parameters);
- Assert.Null(bParamNode.Matches);
- var paramCNodeKvp = Assert.Single(bParamNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ConstrainedParameterTrimming_BothCandidates_WhenLitteralPatternMeetsConstraintAndRoutePattern()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("aa/b/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("{a:length(2)}/b/c");
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("aa/c");
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- // Branch aa -> c = (aa/c)
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("aa", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- Assert.True(aNodeValue.Literals.TryGetValue("c", out var cNode));
- Assert.Same(endpoint3, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch (aa) -> b -> c = (aa/b/c, {a:length(2)}/b/c)
- Assert.True(aNodeValue.Literals.TryGetValue("b", out var bNode));
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramBCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramBCNodeKvp.Key);
- var paramBCNode = paramBCNodeKvp.Value;
- Assert.Equal(new[] { endpoint1, endpoint2 }, paramBCNode.Matches.ToArray());
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch {param} -> b -> c = ({a:length(2)}/b/c)
- var bParamNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bParamNodeKvp.Key);
- var bParamNode = bParamNodeKvp.Value;
- Assert.Null(bParamNode.Parameters);
- Assert.Null(bParamNode.Matches);
- var paramCNodeKvp = Assert.Single(bParamNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ComplexParameter_LiteralDoesNotMatchComplexParameter()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a{value}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("a", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- var cNodeKvp = Assert.Single(aNodeValue.Literals);
- Assert.Equal("c", cNodeKvp.Key);
- var cNode = cNodeKvp.Value;
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- var bNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bNodeKvp.Key);
- var bNode = bNodeKvp.Value;
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ComplexParameter_LiteralMatchesComplexParameter()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("aa/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a{value}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- // Branch aa -> c = (aa/c)
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("aa", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- Assert.True(aNodeValue.Literals.TryGetValue("c", out var cNode));
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch (aa) -> b -> c = (a{value}/b/c)
- Assert.True(aNodeValue.Literals.TryGetValue("b", out var bNode));
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramBCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramBCNodeKvp.Key);
- var paramBCNode = paramBCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramBCNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch {param} -> b -> c = (a{value}/b/c)
- var bParamNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bParamNodeKvp.Key);
- var bParamNode = bParamNodeKvp.Value;
- Assert.Null(bParamNode.Parameters);
- Assert.Null(bParamNode.Matches);
- var paramCNodeKvp = Assert.Single(bParamNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ConstrainedComplexParameter_LiteralMatchesComplexParameterButNotConstraint()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("aa/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a{value:int}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("aa", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- var cNodeKvp = Assert.Single(aNodeValue.Literals);
- Assert.Equal("c", cNodeKvp.Key);
- var cNode = cNodeKvp.Value;
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- var bNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bNodeKvp.Key);
- var bNode = bNodeKvp.Value;
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ComplexParameter_LiteralMatchesComplexParameterAndPartConstraint()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a1/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a{value:int}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- // Branch aa -> c = (a1/c)
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("a1", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- Assert.True(aNodeValue.Literals.TryGetValue("c", out var cNode));
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch (a1) -> b -> c = (a{value:int}/b/c)
- Assert.True(aNodeValue.Literals.TryGetValue("b", out var bNode));
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramBCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramBCNodeKvp.Key);
- var paramBCNode = paramBCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramBCNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch {param} -> b -> c = (a{value:int}/b/c)
- var bParamNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bParamNodeKvp.Key);
- var bParamNode = bParamNodeKvp.Value;
- Assert.Null(bParamNode.Parameters);
- Assert.Null(bParamNode.Matches);
- var paramCNodeKvp = Assert.Single(bParamNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ComplexParameter_EvaluatesAllPartsAndConstraints()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a-11-b-true/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a-{value:int:length(2)}-b-{other:bool}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- // Branch a11-b-true -> c = (a11-b-true/c)
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("a-11-b-true", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- Assert.True(aNodeValue.Literals.TryGetValue("c", out var cNode));
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch (a-11-b-true) -> b -> c = (a-{value:int:length(2)}-b-{other:bool}/b/c)
- Assert.True(aNodeValue.Literals.TryGetValue("b", out var bNode));
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramBCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramBCNodeKvp.Key);
- var paramBCNode = paramBCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramBCNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch {param} -> b -> c = (a-{value:int:length(2)}-b-{other:bool}/b/c)
- var bParamNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bParamNodeKvp.Key);
- var bParamNode = bParamNodeKvp.Value;
- Assert.Null(bParamNode.Parameters);
- Assert.Null(bParamNode.Matches);
- var paramCNodeKvp = Assert.Single(bParamNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Theory]
- [InlineData("a-11-b-true/c", "a-11-b-true", "c")]
- [InlineData("a-ddd-b-true/c", "a-ddd-b-true", "c")]
- [InlineData("a-111-b-0/c", "a-111-b-0", "c")]
- public void BuildDfaTree_MultipleEndpoint_ComplexParameter_Trims_When_OneConstraintFails(string candidate, string firstSegment, string secondSegment)
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint(candidate);
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a-{value:int:length(3)}-b-{other:bool}/b/c");
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- // Branch a-11-b-true -> c = (a11-b-true/c)
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal(firstSegment, aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- var cNodeKvp = aNodeValue.Literals.Single();
- Assert.Equal(secondSegment, cNodeKvp.Key);
- var cNode = cNodeKvp.Value;
- Assert.Same(endpoint1, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch {param} -> b -> c = (a-{value:int:length(2)}-b-{other:bool}/b/c)
- var bParamNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bParamNodeKvp.Key);
- var bParamNode = bParamNodeKvp.Value;
- Assert.Null(bParamNode.Parameters);
- Assert.Null(bParamNode.Matches);
- var paramCNodeKvp = Assert.Single(bParamNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ComplexParameter_BothCandidates_WhenLitteralPatternMatchesComplexParameterAndRoutePattern()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("aa/b/c");
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a{value}/b/c");
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("aa/c");
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.NotNull(root.Parameters);
- // Branch aa -> c = (aa/c)
- var aNodeKvp = Assert.Single(root.Literals);
- Assert.Equal("aa", aNodeKvp.Key);
- var aNodeValue = aNodeKvp.Value;
- Assert.True(aNodeValue.Literals.TryGetValue("c", out var cNode));
- Assert.Same(endpoint3, Assert.Single(cNode.Matches));
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch (aa) -> b -> c = (aa/b/c, a{value}/b/c)
- Assert.True(aNodeValue.Literals.TryGetValue("b", out var bNode));
- Assert.Null(bNode.Parameters);
- Assert.Null(bNode.Matches);
- var paramBCNodeKvp = Assert.Single(bNode.Literals);
- Assert.Equal("c", paramBCNodeKvp.Key);
- var paramBCNode = paramBCNodeKvp.Value;
- Assert.Equal(new[] { endpoint1, endpoint2 }, paramBCNode.Matches.ToArray());
- Assert.Null(cNode.Literals);
- Assert.Null(cNode.Parameters);
- // Branch {param} -> b -> c = (a{value}/b/c)
- var bParamNodeKvp = Assert.Single(root.Parameters.Literals);
- Assert.Equal("b", bParamNodeKvp.Key);
- var bParamNode = bParamNodeKvp.Value;
- Assert.Null(bParamNode.Parameters);
- Assert.Null(bParamNode.Matches);
- var paramCNodeKvp = Assert.Single(bParamNode.Literals);
- Assert.Equal("c", paramCNodeKvp.Key);
- var paramCNode = paramCNodeKvp.Value;
- Assert.Same(endpoint2, Assert.Single(paramCNode.Matches));
- Assert.Null(paramCNode.Literals);
- Assert.Null(paramCNode.Parameters);
- }
- // Regression test for excessive memory usage https://github.com/dotnet/aspnetcore/issues/23850
- [Fact]
- public void BuildDfaTree_CanHandle_LargeAmountOfRoutes_WithConstraints()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoints = new[]{
- CreateEndpoint("test1/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test1/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test1/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test1/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test1/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test1/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test1/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test1/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test1/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test2/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test2/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test2/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test2/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test2/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test2/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test2/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test2/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test2/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test3/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test3/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test3/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test3/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test3/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test3/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test3/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test3/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test3/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test4/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test4/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test4/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test4/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test4/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test4/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test4/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test4/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test4/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test5/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test5/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test5/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test5/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test5/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test5/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test5/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test5/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test5/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test6/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test6/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test6/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test6/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test6/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test6/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test6/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test6/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test6/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test7/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test7/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test7/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test7/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test7/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test7/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test7/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test7/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test7/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test8/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test8/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test8/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test8/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test8/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test8/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test8/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test8/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test8/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test9/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test9/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test9/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test9/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test9/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test9/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test9/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test9/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test9/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test10/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test10/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test10/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test10/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test10/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test10/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test10/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test10/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test10/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test11/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test11/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test11/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test11/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test11/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test11/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test11/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test11/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test11/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test12/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test12/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test12/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test12/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test12/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test12/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test12/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test12/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test12/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test13/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test13/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test13/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test13/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test13/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test13/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test13/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test13/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test13/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test14/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test14/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test14/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test14/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test14/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test14/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test14/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test14/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test14/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test15/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test15/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test15/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test15/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test15/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test15/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test15/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test15/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test15/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test16/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test16/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test16/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test16/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test16/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test16/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test16/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test16/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test16/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test17/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test17/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test17/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test17/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test17/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test17/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test17/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test17/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test17/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test18/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test18/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test18/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test18/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test18/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test18/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test18/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test18/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test18/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test19/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test19/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test19/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test19/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test19/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test19/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test19/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test19/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test19/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test20/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test20/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test20/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test20/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test20/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test20/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test20/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test20/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test20/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test21/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test21/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test21/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test21/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test21/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test21/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test21/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test21/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test21/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test22/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test22/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test22/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test22/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test22/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test22/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test22/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test22/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test22/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test23/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test23/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test23/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test23/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test23/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test23/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test23/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test23/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test23/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test24/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test24/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test24/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test24/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test24/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test24/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test24/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test24/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test24/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test25/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test25/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test25/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test25/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test25/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test25/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test25/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test25/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test25/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test26/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test26/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test26/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test26/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test26/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test26/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test26/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test26/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test26/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test27/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test27/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test27/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test27/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test27/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test27/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test27/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test27/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test27/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test28/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test28/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test28/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test28/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test28/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test28/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test28/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test28/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test28/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test29/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test29/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test29/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test29/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test29/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test29/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test29/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test29/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test29/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test30/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test30/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test30/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test30/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test30/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test30/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test30/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test30/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test30/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test31/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test31/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test31/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test31/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test31/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test31/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test31/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test31/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test31/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test32/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test32/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test32/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test32/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test32/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test32/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test32/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test32/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test32/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test33/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test33/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test33/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test33/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test33/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test33/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test33/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test33/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test33/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test34/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test34/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test34/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test34/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test34/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test34/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test34/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test34/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test34/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test35/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test35/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test35/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test35/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test35/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test35/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test35/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test35/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test35/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test36/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test36/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test36/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test36/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test36/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test36/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test36/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test36/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test36/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test37/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test37/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test37/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test37/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test37/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test37/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test37/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test37/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test37/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test38/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test38/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test38/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test38/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test38/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test38/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test38/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test38/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test38/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test39/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test39/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test39/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test39/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test39/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test39/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test39/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test39/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test39/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test40/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test40/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test40/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test40/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test40/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test40/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test40/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test40/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test40/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test41/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test41/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test41/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test41/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test41/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test41/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test41/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test41/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test41/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test42/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test42/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test42/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test42/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test42/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test42/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test42/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test42/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test42/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test43/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test43/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test43/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test43/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test43/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test43/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test43/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test43/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test43/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test44/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test44/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test44/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test44/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test44/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test44/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test44/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test44/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test44/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test45/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test45/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test45/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test45/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test45/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test45/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test45/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test45/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test45/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test46/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test46/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test46/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test46/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test46/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test46/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test46/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test46/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test46/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test47/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test47/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test47/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test47/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test47/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test47/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test47/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test47/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test47/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test48/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test48/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test48/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test48/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test48/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test48/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test48/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test48/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test48/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test49/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test49/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test49/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test49/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test49/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test49/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test49/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test49/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test49/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test50/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test50/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test50/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test50/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test50/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test50/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test50/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test50/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test50/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test51/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test51/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test51/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test51/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test51/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test51/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test51/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test51/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test51/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test52/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test52/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test52/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test52/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test52/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test52/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test52/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test52/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test52/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test53/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test53/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test53/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test53/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test53/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test53/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test53/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test53/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test53/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test54/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test54/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test54/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test54/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test54/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test54/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test54/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test54/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test54/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test55/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test55/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test55/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test55/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test55/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test55/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test55/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test55/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test55/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test56/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test56/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test56/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test56/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test56/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test56/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test56/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test56/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test56/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test57/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test57/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test57/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test57/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test57/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test57/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test57/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test57/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test57/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test58/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test58/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test58/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test58/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test58/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test58/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test58/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test58/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test58/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test59/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test59/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test59/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test59/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test59/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test59/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test59/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test59/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test59/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test60/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test60/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test60/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test60/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test60/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test60/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test60/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test60/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test60/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test61/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test61/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test61/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test61/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test61/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test61/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test61/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test61/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test61/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test62/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test62/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test62/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test62/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test62/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test62/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test62/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test62/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test62/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test63/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{language:length(2)}/test63/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test63/method-1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("test63/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test63/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test63/method-2", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("test63/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{language:length(2)}/test63/method-3", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("{version:int}/{language:length(2)}/test63/method-3", new HttpMethodMetadata(new[] { "POST" }))
- };
- foreach (var endpoint in endpoints)
- {
- builder.AddEndpoint(endpoint);
- }
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.NotNull(root);
- var count = 0;
- root.Visit(node => count++);
- // Without filtering it would have resulted in millions of nodes, several GB of memory and minutes
- Assert.Equal(759, count);
- }
- // Regression test for excessive memory usage https://github.com/dotnet/aspnetcore/issues/33735
- [Fact]
- public void BuildDfaTree_Regression_33735()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoints = new[]
- {
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workers/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/workers/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workers/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/workers/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workers/{id:regex((?!(discover)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/workers/{id:regex((?!(discover)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workerpools", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/workerpools", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workerpools/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/workerpools/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workerpools/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/workerpools/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workerpools/{id:regex((?!(all|summary|supportedtypes|dynamicworkertypes)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/workerpools/{id:regex((?!(all|summary|supportedtypes|dynamicworkertypes)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/workerpools", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/workerpools", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/variables/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/variables/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/variables/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/variables/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/users/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/users/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/users/{id:regex((?!(all|authentication|external-search|identity-metadata|me)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/users", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/users/invitations/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/users/invitations/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/userroles/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/userroles/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/userroles/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/userroles", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/userroles/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/users/{id}/permissions/export", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/users/{id}/permissions/export", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/tenants", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}/logo", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}/logo", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/variables-missing", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants/variables-missing", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/status", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants/status", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}/variables", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}/variables", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/tenants/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}/variables", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}/variables", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}/variables", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}/variables", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}/logo", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}/logo", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/{id:regex(^Tenants-\\d\u002B$)}/logo", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/tenants/{id:regex(^Tenants-\\d\u002B$)}/logo", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tenants/tag-test", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tenants/tag-test", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teams", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/teams", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teams/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/teams/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teams/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/teams/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teams/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/teams/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teams", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/teams", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teams/{id}/scopeduserroles", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/teams/{id}/scopeduserroles", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teams/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/teams/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teammembership", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/teammembership", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/teammembership/previewteam", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/teammembership/previewteam", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tagsets/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/tagsets/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tagsets/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tagsets/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tagsets/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tagsets/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/tagsets", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/tagsets", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/subscriptions/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/subscriptions/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/subscriptions/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/subscriptions/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/subscriptions/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/subscriptions/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/subscriptions", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/subscriptions", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/{stepId}/{version}/logo", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/deploymenttargets/{stepId}/{version}/logo", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/{stepId}/{version}/schema", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/deploymenttargets/{stepId}/{version}/schema", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/{stepId}/latest-version", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/{stepId}/{version}.js", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/deploymenttargets/{stepId}/{version}.js", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/steps/deploymenttargets", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/spaces/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/spaces/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/spaces", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/spaces/{id:regex(^Spaces-\\d\u002B$)}/search", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/spaces/{id:regex(^Spaces-\\d\u002B$)}/search", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/scopeduserroles/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/scopeduserroles/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/scopeduserroles/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/scopeduserroles/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/runbooks", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/runbooks", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/runbooks/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/{id}/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}/runbookRuns/preview/{environment}/{tenant}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}/runbookRuns/preview/{environment}/{tenant}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}/runbookRuns/preview/{environment}/{tenant}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}/runbookRuns/preview/{environment}/{tenant}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}/runbookRuns/preview/{environment}/{tenant}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/{id}/runbookRuns/preview/{environment}/{tenant}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}/runbookRuns/preview/{environment}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}/runbookRuns/preview/{environment}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}/runbookRuns/preview/{environment}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}/runbookRuns/preview/{environment}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}/runbookRuns/preview/{environment}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/{id}/runbookRuns/preview/{environment}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}/runbookRunTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}/runbookRunTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}/runbookRunTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}/runbookRunTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}/runbookRunTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/{id}/runbookRunTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/runbooks/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}/run", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}/run", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}/run", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}/run", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}/run", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/runbooks/{id}/run", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooksnapshots/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/runbooksnapshots/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooksnapshots/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/runbooksnapshots/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooksnapshots/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooksnapshots/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookSnapshots/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookSnapshots/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookSnapshots/{idOrName}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookSnapshots/{idOrName}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookSnapshots/{idOrName}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookSnapshots/{idOrName}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbooks/{id}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbooks/{id}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbooks/{id}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbooks/{id}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbooks/{id}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbooks/{id}/runbookSnapshots", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookRuns", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/runbookRuns", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookRuns", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/runbookRuns", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookRuns", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookRuns", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookruns/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/runbookruns/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookruns/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/runbookruns/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookruns/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookruns/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookRuns/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookRuns/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookRuns/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookRuns/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookRuns/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookRuns/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookProcesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookProcesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookProcesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookProcesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookProcesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookProcesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookProcesses/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookProcesses/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookProcesses/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookProcesses/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookProcesses/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookProcesses/{id}/runbookSnapshotTemplate", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookSnapshots/{id}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/runbookSnapshots/{id}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookSnapshots/{id}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/runbookSnapshots/{id}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookSnapshots/{id}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookSnapshots/{id}/runbookRuns", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/runbookProcesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/reporting/deployments/xml", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/reporting/deployments/xml", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/releases/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/releases/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/releases/{id}/deployments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/releases/{id}/deployments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels/{id}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/channels/{id}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/channels/{id}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/channels/{id}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/channels/{id}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/channels/{id}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/releases", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/proxies/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/proxies/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/proxies/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/proxies/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/proxies", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/proxies", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/proxies/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/proxies/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projecttriggers/{triggerId}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projecttriggers/{triggerId}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projecttriggers/{triggerId}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projecttriggers/{triggerId}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/triggers/{triggerId}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projecttriggers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projecttriggers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/triggers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/triggers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/triggers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/triggers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/experimental/summaries", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/experimental/summaries", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/vcs/modified", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/vcs/modified", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projectgroups/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projectgroups/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projectgroups/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projectgroups/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projectgroups/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projectgroups/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projectgroups/{id}/projects", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projectgroups/{id}/projects", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projectgroups", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projectgroups", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/octopusservernodes/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/octopusservernodes/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/octopusservernodes/{id:regex((?!(ping|summary)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/octopusservernodes", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machines/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/machines/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machines/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machines/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machines/{id:regex((?!(discover)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machines/{id:regex((?!(discover)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machinepolicies/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/machinepolicies/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machinepolicies/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machinepolicies/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machinepolicies", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machinepolicies", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machinepolicies/{id:regex((?!(template)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machinepolicies/{id:regex((?!(template)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machinepolicies/{id}/machines", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machinepolicies/{id}/machines", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machinepolicies/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machinepolicies/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/machinepolicies/{id}/workers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/machinepolicies/{id}/workers", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/lifecycles/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/lifecycles/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/lifecycles/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/lifecycles/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/lifecycles/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/lifecycles/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/lifecycles", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/lifecycles", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/libraryvariablesets/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/libraryvariablesets/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/libraryvariablesets/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/libraryvariablesets/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/libraryvariablesets/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/libraryvariablesets/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/interruptions/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/interruptions/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/feeds/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/feeds/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/environments/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/environments/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/environments/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/environments/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/environments/{id:regex((?!(summary)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/environments/{id:regex((?!(summary)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/environments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deployments", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/deployments", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deployments/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/deployments/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deployments/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/deployments/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deployments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/deployments", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings/ocl/raw", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings/ocl/raw", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deploymentsettings/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/deploymentsettings/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentsettings", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentsettings", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings/ocl/raw", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings/ocl/raw", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deploymentsettings/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/deploymentsettings/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentsettings", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentsettings", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentsettings", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deploymentprocesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/deploymentprocesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/ocl/raw", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/ocl/raw", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deploymentprocesses/{deploymentProcessId}/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/deploymentprocesses/{deploymentProcessId}/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocesses/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocesses/template", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deploymentprocesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/deploymentprocesses/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/ocl/raw", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/ocl/raw", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/deploymentprocesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/deploymentprocesses/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocesses", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocesses", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocess/validate", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/deploymentprocess/validate", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/validate", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/deploymentprocesses/validate", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/configuration/retention-default", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/configuration/retention-default", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/configuration/certificates/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/communityactiontemplates/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/communityactiontemplates", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/channels", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/channels", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/channels", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/channels", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/channels", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/channels/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/channels/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/channels/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/channels/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/channels/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/channels/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels/{id:regex((?!(rule-test)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/channels/{id:regex((?!(rule-test)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/channels/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/channels/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/channels/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/channels/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/channels", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/channels", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/channels", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/channels", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/projects/{projectId:regex(^Projects-\\d\u002B$)}/{gitRef}/channels", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/channels/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId}/channels/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/projects/{projectId}/{gitRef}/channels/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/projects/{projectId}/{gitRef}/channels/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/channels/{id}", new HttpMethodMetadata(new[] { "PUT" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels/rule-test", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/channels/rule-test", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/channels/rule-test", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/channels/rule-test", new HttpMethodMetadata(new[] { "POST" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/certificates/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/certificates/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/certificates/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/certificates/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/build-information/bulk", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/build-information/bulk", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/build-information/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/build-information/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/artifacts/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/artifacts/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/artifacts/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/artifacts/{id}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/actiontemplates/{id:regex((?!(search|categories)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/actiontemplates/{id:regex((?!(search|categories)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/actiontemplates", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/actiontemplates", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/actiontemplates/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/actiontemplates/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/accounts/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/accounts/{id}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/accounts/{id}/pk", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/accounts/{id}/pk", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/accounts/{id:regex((?!(azureenvironments)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/accounts/{id:regex((?!(azureenvironments)))}", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/{baseSpaceId:regex(Spaces-\\d\u002B)}/accounts/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/accounts/all", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("api/diagnostics/throw", new HttpMethodMetadata(new[] { "GET" })),
- };
- foreach (var endpoint in endpoints)
- {
- builder.AddEndpoint(endpoint);
- }
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.NotNull(root);
- var count = 0;
- root.Visit(node => count++);
- // Without filtering it would have resulted in several order of magnitudes more nodes and much more memory
- Assert.Equal(2964, count);
- }
- // Another regression test based on OData models
- [Fact]
- public void BuildDfaTree_CanHandle_LargeAmountOfRoutes_WithComplexParameters()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoints = new[]{
- CreateEndpoint("Student", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student1", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student1/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student1", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student1({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student1({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student1/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student1({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student1/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student2", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student2", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student2/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student2", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student2({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student2({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student2/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student2({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student2/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student3", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student3", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student3/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student3", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student3({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student3({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student3/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student3({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student3/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student4", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student4", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student4/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student4", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student4({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student4({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student4/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student4({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student4/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student5", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student5", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student5/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student5", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student5({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student5({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student5/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student5({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student5/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student6", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student6", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student6/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student6", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student6({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student6({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student6/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student6({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student6/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student7", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student7", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student7/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student7", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student7({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student7({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student7/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student7({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student7/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student8", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student8", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student8/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student8", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student8({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student8({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student8/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student8({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student8/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student9", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student9", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student9/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student9", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student9({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student9({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student9/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student9({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student9/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student10", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student10", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student10/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student10", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student10({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student10({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student10/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student10({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student10/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student11", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student11", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student11/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student11", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student11({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student11({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student11/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student11({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student11/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student12", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student12", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student12/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student12", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student12({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student12({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student12/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student12({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student12/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student13", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student13", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student13/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student13", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student13({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student13({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student13/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student13({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student13/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student14", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student14", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student14/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student14", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student14({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student14({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student14/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student14({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student14/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student15", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student15", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student15/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student15", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student15({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student15({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student15/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student15({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student15/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student16", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student16", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student16/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student16", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student16({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student16({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student16/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student16({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student16/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student17", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student17", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student17/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student17", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student17({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student17({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student17/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student17({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student17/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student18", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student18", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student18/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student18", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student18({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student18({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student18/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student18({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student18/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student19", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student19", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student19/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student19", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student19({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student19({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student19/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student19({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student19/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student20", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student20", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student20/$count", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}/Student20", new HttpMethodMetadata(new[] { "PATCH" })),
- CreateEndpoint("Student20({propName}={propValue})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student20({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("Student20/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student20({key})", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/Student20/{key}", new HttpMethodMetadata(new[] { "DELETE" })),
- CreateEndpoint("{contextToken}/$metadata", new HttpMethodMetadata(new[] { "GET" })),
- CreateEndpoint("{contextToken}", new HttpMethodMetadata(new[] { "GET" })),
- };
- foreach (var endpoint in endpoints)
- {
- builder.AddEndpoint(endpoint);
- }
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.NotNull(root);
- var count = 0;
- root.Visit(node => count++);
- // Without filtering it would have resulted in several order of magnitudes more nodes and much more memory
- Assert.Equal(1453, count);
- }
- // Regression test for https://github.com/dotnet/aspnetcore/issues/16579
- //
- // This case behaves the same for all combinations.
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ParameterAndCatchAll_OnSameNode_Order1()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/{b}", order: 0);
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/{*b}", order: 1);
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Same(endpoint2, Assert.Single(a.Matches));
- Assert.Null(a.Literals);
- var b = a.Parameters;
- Assert.Collection(
- b.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(b.Literals);
- Assert.Null(b.Parameters);
- Assert.NotNull(b.CatchAll);
- var catchAll = b.CatchAll;
- Assert.Same(endpoint2, Assert.Single(catchAll.Matches));
- Assert.Null(catchAll.Literals);
- Assert.Same(catchAll, catchAll.Parameters);
- Assert.Same(catchAll, catchAll.CatchAll);
- }
- // Regression test for https://github.com/dotnet/aspnetcore/issues/16579
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_ParameterAndCatchAll_OnSameNode_Order2()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/{*b}", order: 0);
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/{b}", order: 1);
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Same(endpoint1, Assert.Single(a.Matches));
- Assert.Null(a.Literals);
- var b = a.Parameters;
- Assert.Collection(
- b.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(b.Literals);
- Assert.Null(b.Parameters);
- Assert.NotNull(b.CatchAll);
- var catchAll = b.CatchAll;
- Assert.Same(endpoint1, Assert.Single(catchAll.Matches));
- Assert.Null(catchAll.Literals);
- Assert.Same(catchAll, catchAll.Parameters);
- Assert.Same(catchAll, catchAll.CatchAll);
- }
- // Regression test for https://github.com/dotnet/aspnetcore/issues/18677
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_CatchAllWithHigherPrecedenceThanParameter_Order1()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("{a}/{b}", order: 0);
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("a/{*b}", order: 1);
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a1 = next.Value;
- Assert.Same(endpoint2, Assert.Single(a1.Matches));
- Assert.Null(a1.Literals);
- var b1 = a1.Parameters;
- Assert.Collection(
- b1.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(b1.Literals);
- Assert.Null(b1.Parameters);
- Assert.NotNull(b1.CatchAll);
- var catchAll1 = b1.CatchAll;
- Assert.Same(endpoint2, Assert.Single(catchAll1.Matches));
- Assert.Null(catchAll1.Literals);
- Assert.Same(catchAll1, catchAll1.Parameters);
- Assert.Same(catchAll1, catchAll1.CatchAll);
- var a2 = root.Parameters;
- Assert.Null(a2.Matches);
- Assert.Null(a2.Literals);
- var b2 = a2.Parameters;
- Assert.Collection(
- b2.Matches,
- e => Assert.Same(endpoint1, e));
- Assert.Null(b2.Literals);
- Assert.Null(b2.Parameters);
- Assert.Null(b2.CatchAll);
- }
- // Regression test for https://github.com/dotnet/aspnetcore/issues/18677
- [Fact]
- public void BuildDfaTree_MultipleEndpoint_CatchAllWithHigherPrecedenceThanParameter_Order2()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateEndpoint("a/{*b}", order: 0);
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("{a}/{b}", order: 1);
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a1 = next.Value;
- Assert.Same(endpoint1, Assert.Single(a1.Matches));
- Assert.Null(a1.Literals);
- var b1 = a1.Parameters;
- Assert.Collection(
- b1.Matches,
- e => Assert.Same(endpoint1, e),
- e => Assert.Same(endpoint2, e));
- Assert.Null(b1.Literals);
- Assert.Null(b1.Parameters);
- Assert.NotNull(b1.CatchAll);
- var catchAll1 = b1.CatchAll;
- Assert.Same(endpoint1, Assert.Single(catchAll1.Matches));
- Assert.Null(catchAll1.Literals);
- Assert.Same(catchAll1, catchAll1.Parameters);
- Assert.Same(catchAll1, catchAll1.CatchAll);
- var a2 = root.Parameters;
- Assert.Null(a2.Matches);
- Assert.Null(a2.Literals);
- var b2 = a2.Parameters;
- Assert.Collection(
- b2.Matches,
- e => Assert.Same(endpoint2, e));
- Assert.Null(b2.Literals);
- Assert.Null(b2.Parameters);
- Assert.Null(b2.CatchAll);
- }
- private void BuildDfaTree_MultipleEndpoint_CatchAllWithHigherPrecedenceThanParameter_Order2_Legacy30Behavior_Core(DfaMatcherBuilder builder)
- {
- // Arrange
- var endpoint1 = CreateEndpoint("a/{*b}", order: 0);
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("{a}/{b}", order: 1);
- builder.AddEndpoint(endpoint2);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a1 = next.Value;
- Assert.Same(endpoint1, Assert.Single(a1.Matches));
- Assert.Null(a1.Literals);
- var b1 = a1.Parameters;
- Assert.Same(endpoint2, Assert.Single(b1.Matches));
- Assert.Null(b1.Literals);
- Assert.Null(b1.Parameters);
- Assert.Null(b1.CatchAll);
- var a2 = root.Parameters;
- Assert.Null(a2.Matches);
- Assert.Null(a2.Literals);
- var b2 = a2.Parameters;
- Assert.Collection(
- b2.Matches,
- e => Assert.Same(endpoint2, e));
- Assert.Null(b2.Literals);
- Assert.Null(b2.Parameters);
- Assert.Null(b2.CatchAll);
- }
- [Fact]
- public void BuildDfaTree_WithPolicies()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder(new TestMetadata1MatcherPolicy(), new TestMetadata2MatcherPolicy());
- var endpoint1 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(0), new TestMetadata2(true), });
- builder.AddEndpoint(endpoint1);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Empty(a.Matches);
- Assert.IsType<TestMetadata1MatcherPolicy>(a.NodeBuilder);
- Assert.Collection(
- a.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(0, e.Key));
- var test1_0 = a.PolicyEdges[0];
- Assert.Empty(a.Matches);
- Assert.IsType<TestMetadata2MatcherPolicy>(test1_0.NodeBuilder);
- Assert.Collection(
- test1_0.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(true, e.Key));
- var test2_true = test1_0.PolicyEdges[true];
- Assert.Same(endpoint1, Assert.Single(test2_true.Matches));
- Assert.Null(test2_true.NodeBuilder);
- Assert.Null(test2_true.PolicyEdges);
- }
- [Fact]
- public void BuildDfaTree_WithPolicies_AndBranches()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder(new TestMetadata1MatcherPolicy(), new TestMetadata2MatcherPolicy());
- var endpoint1 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(0), new TestMetadata2(true), });
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(1), new TestMetadata2(true), });
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(1), new TestMetadata2(false), });
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Empty(a.Matches);
- Assert.IsType<TestMetadata1MatcherPolicy>(a.NodeBuilder);
- Assert.Collection(
- a.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(0, e.Key),
- e => Assert.Equal(1, e.Key));
- var test1_0 = a.PolicyEdges[0];
- Assert.Empty(test1_0.Matches);
- Assert.IsType<TestMetadata2MatcherPolicy>(test1_0.NodeBuilder);
- Assert.Collection(
- test1_0.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(true, e.Key));
- var test2_true = test1_0.PolicyEdges[true];
- Assert.Same(endpoint1, Assert.Single(test2_true.Matches));
- Assert.Null(test2_true.NodeBuilder);
- Assert.Null(test2_true.PolicyEdges);
- var test1_1 = a.PolicyEdges[1];
- Assert.Empty(test1_1.Matches);
- Assert.IsType<TestMetadata2MatcherPolicy>(test1_1.NodeBuilder);
- Assert.Collection(
- test1_1.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(false, e.Key),
- e => Assert.Equal(true, e.Key));
- test2_true = test1_1.PolicyEdges[true];
- Assert.Same(endpoint2, Assert.Single(test2_true.Matches));
- Assert.Null(test2_true.NodeBuilder);
- Assert.Null(test2_true.PolicyEdges);
- var test2_false = test1_1.PolicyEdges[false];
- Assert.Same(endpoint3, Assert.Single(test2_false.Matches));
- Assert.Null(test2_false.NodeBuilder);
- Assert.Null(test2_false.PolicyEdges);
- }
- [Fact]
- public void BuildDfaTree_WithPolicies_AndBranches_FirstPolicySkipped()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder(new TestMetadata1MatcherPolicy(), new TestMetadata2MatcherPolicy());
- var endpoint1 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata2(true), });
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata2(true), });
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata2(false), });
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Empty(a.Matches);
- Assert.IsType<TestMetadata2MatcherPolicy>(a.NodeBuilder);
- Assert.Collection(
- a.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(false, e.Key),
- e => Assert.Equal(true, e.Key));
- var test2_true = a.PolicyEdges[true];
- Assert.Equal(new[] { endpoint1, endpoint2, }, test2_true.Matches);
- Assert.Null(test2_true.NodeBuilder);
- Assert.Null(test2_true.PolicyEdges);
- var test2_false = a.PolicyEdges[false];
- Assert.Equal(new[] { endpoint3, }, test2_false.Matches);
- Assert.Null(test2_false.NodeBuilder);
- Assert.Null(test2_false.PolicyEdges);
- }
- [Fact]
- public void BuildDfaTree_WithPolicies_AndBranches_SecondSkipped()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder(new TestMetadata1MatcherPolicy(), new TestMetadata2MatcherPolicy());
- var endpoint1 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(0), });
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(1), });
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(1), });
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Empty(a.Matches);
- Assert.IsType<TestMetadata1MatcherPolicy>(a.NodeBuilder);
- Assert.Collection(
- a.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(0, e.Key),
- e => Assert.Equal(1, e.Key));
- var test1_0 = a.PolicyEdges[0];
- Assert.Equal(new[] { endpoint1, }, test1_0.Matches);
- Assert.Null(test1_0.NodeBuilder);
- Assert.Null(test1_0.PolicyEdges);
- var test1_1 = a.PolicyEdges[1];
- Assert.Equal(new[] { endpoint2, endpoint3, }, test1_1.Matches);
- Assert.Null(test1_1.NodeBuilder);
- Assert.Null(test1_1.PolicyEdges);
- }
- [Fact]
- public void BuildDfaTree_WithPolicies_AndBranches_NonRouteEndpoint()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder(new TestNonRoutePatternMatcherPolicy());
- var endpoint1 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(0), });
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(1), });
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("/a", metadata: new object[] { new TestMetadata1(1), });
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Empty(a.Matches);
- Assert.IsType<TestNonRoutePatternMatcherPolicy>(a.NodeBuilder);
- Assert.Collection(
- a.PolicyEdges.OrderBy(e => e.Key),
- e => Assert.Equal(0, e.Key),
- e => Assert.Equal(1, e.Key),
- e => Assert.Equal(int.MaxValue, e.Key));
- var test1_0 = a.PolicyEdges[0];
- Assert.Equal(new[] { endpoint1, }, test1_0.Matches);
- Assert.Null(test1_0.NodeBuilder);
- Assert.Null(test1_0.PolicyEdges);
- var test1_1 = a.PolicyEdges[1];
- Assert.Equal(new[] { endpoint2, endpoint3, }, test1_1.Matches);
- Assert.Null(test1_1.NodeBuilder);
- Assert.Null(test1_1.PolicyEdges);
- var nonRouteEndpoint = a.PolicyEdges[int.MaxValue];
- Assert.Equal("MaxValueEndpoint", Assert.Single(nonRouteEndpoint.Matches).DisplayName);
- }
- [Fact]
- public void BuildDfaTree_WithPolicies_AndBranches_BothPoliciesSkipped()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder(new TestMetadata1MatcherPolicy(), new TestMetadata2MatcherPolicy());
- var endpoint1 = CreateEndpoint("/a", metadata: new object[] { });
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("/a", metadata: new object[] { });
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("/a", metadata: new object[] { });
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("a", next.Key);
- var a = next.Value;
- Assert.Equal(new[] { endpoint1, endpoint2, endpoint3, }, a.Matches);
- Assert.Null(a.NodeBuilder);
- Assert.Null(a.PolicyEdges);
- }
- // Verifies that we sort the endpoints before calling into policies.
- //
- // The builder uses a different sort order when building the tree, vs when building the policy nodes. Policy
- // nodes should see an "absolute" order.
- [Fact]
- public void BuildDfaTree_WithPolicies_SortedAccordingToScore()
- {
- // Arrange
- //
- // These cases where chosen where the absolute order incontrolled explicitly by setting .Order, but
- // the precedence of segments is different, so these will be sorted into different orders when building
- // the tree.
- var policies = new MatcherPolicy[]
- {
- new TestMetadata1MatcherPolicy(),
- new TestMetadata2MatcherPolicy(),
- };
- var comparer = new EndpointComparer(policies.OrderBy(p => p.Order).OfType<IEndpointComparerPolicy>().ToArray());
- var builder = CreateDfaMatcherBuilder(policies);
- ((TestMetadata1MatcherPolicy)policies[0]).OnGetEdges = VerifyOrder;
- ((TestMetadata2MatcherPolicy)policies[1]).OnGetEdges = VerifyOrder;
- var endpoint1 = CreateEndpoint("/a/{**b}", order: -1, metadata: new object[] { new TestMetadata1(0), new TestMetadata2(true), });
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateEndpoint("/a/{b}/{**c}", order: 0, metadata: new object[] { new TestMetadata1(1), new TestMetadata2(true), });
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateEndpoint("/a/b/{c}", order: 1, metadata: new object[] { new TestMetadata1(1), new TestMetadata2(false), });
- builder.AddEndpoint(endpoint3);
- // Act & Assert
- _ = builder.BuildDfaTree();
- void VerifyOrder(IReadOnlyList<Endpoint> endpoints)
- {
- // The list should already be in sorted order, every time build is called.
- Assert.Equal(endpoints, endpoints.OrderBy(e => e, comparer));
- }
- }
- [Fact]
- public void BuildDfaTree_RequiredValues()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint("{controller}/{action}", requiredValues: new { controller = "Home", action = "Index" });
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("Home", next.Key);
- var home = next.Value;
- Assert.Null(home.Matches);
- Assert.Null(home.Parameters);
- next = Assert.Single(home.Literals);
- Assert.Equal("Index", next.Key);
- var index = next.Value;
- Assert.Same(endpoint, Assert.Single(index.Matches));
- Assert.Null(index.Literals);
- }
- [Fact]
- public void BuildDfaTree_RequiredValues_AndMatchingDefaults()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint(
- "{controller}/{action}",
- defaults: new { controller = "Home", action = "Index" },
- requiredValues: new { controller = "Home", action = "Index" });
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Same(endpoint, Assert.Single(root.Matches));
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("Home", next.Key);
- var home = next.Value;
- Assert.Same(endpoint, Assert.Single(home.Matches));
- Assert.Null(home.Parameters);
- next = Assert.Single(home.Literals);
- Assert.Equal("Index", next.Key);
- var index = next.Value;
- Assert.Same(endpoint, Assert.Single(index.Matches));
- Assert.Null(index.Literals);
- }
- [Fact]
- public void BuildDfaTree_RequiredValues_AndDifferentDefaults()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateSubsitutedEndpoint(
- "{controller}/{action}",
- defaults: new { controller = "Home", action = "Index" },
- requiredValues: new { controller = "Login", action = "Index" });
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("Login", next.Key);
- var login = next.Value;
- Assert.Same(endpoint, Assert.Single(login.Matches));
- Assert.Null(login.Parameters);
- next = Assert.Single(login.Literals);
- Assert.Equal("Index", next.Key);
- var index = next.Value;
- Assert.Same(endpoint, Assert.Single(index.Matches));
- Assert.Null(index.Literals);
- }
- [Fact]
- public void BuildDfaTree_RequiredValues_Multiple()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint1 = CreateSubsitutedEndpoint(
- "{controller}/{action}/{id?}",
- defaults: new { controller = "Home", action = "Index" },
- requiredValues: new { controller = "Home", action = "Index" });
- builder.AddEndpoint(endpoint1);
- var endpoint2 = CreateSubsitutedEndpoint(
- "{controller}/{action}/{id?}",
- defaults: new { controller = "Home", action = "Index" },
- requiredValues: new { controller = "Login", action = "Index" });
- builder.AddEndpoint(endpoint2);
- var endpoint3 = CreateSubsitutedEndpoint(
- "{controller}/{action}/{id?}",
- defaults: new { controller = "Home", action = "Index" },
- requiredValues: new { controller = "Login", action = "ChangePassword" });
- builder.AddEndpoint(endpoint3);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Same(endpoint1, Assert.Single(root.Matches));
- Assert.Null(root.Parameters);
- Assert.Equal(2, root.Literals.Count);
- var home = root.Literals["Home"];
- Assert.Same(endpoint1, Assert.Single(home.Matches));
- Assert.Null(home.Parameters);
- var next = Assert.Single(home.Literals);
- Assert.Equal("Index", next.Key);
- var homeIndex = next.Value;
- Assert.Same(endpoint1, Assert.Single(homeIndex.Matches));
- Assert.Null(homeIndex.Literals);
- Assert.NotNull(homeIndex.Parameters);
- Assert.Same(endpoint1, Assert.Single(homeIndex.Parameters.Matches));
- var login = root.Literals["Login"];
- Assert.Same(endpoint2, Assert.Single(login.Matches));
- Assert.Null(login.Parameters);
- Assert.Equal(2, login.Literals.Count);
- var loginIndex = login.Literals["Index"];
- Assert.Same(endpoint2, Assert.Single(loginIndex.Matches));
- Assert.Null(loginIndex.Literals);
- Assert.NotNull(loginIndex.Parameters);
- Assert.Same(endpoint2, Assert.Single(loginIndex.Parameters.Matches));
- var loginChangePassword = login.Literals["ChangePassword"];
- Assert.Same(endpoint3, Assert.Single(loginChangePassword.Matches));
- Assert.Null(loginChangePassword.Literals);
- Assert.NotNull(loginChangePassword.Parameters);
- Assert.Same(endpoint3, Assert.Single(loginChangePassword.Parameters.Matches));
- }
- [Fact]
- public void BuildDfaTree_RequiredValues_AndParameterTransformer()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint(
- "{controller:slugify}/{action:slugify}",
- defaults: new { controller = "RecentProducts", action = "ViewAll" },
- requiredValues: new { controller = "RecentProducts", action = "ViewAll" });
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Same(endpoint, Assert.Single(root.Matches));
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("recent-products", next.Key);
- var home = next.Value;
- Assert.Same(endpoint, Assert.Single(home.Matches));
- Assert.Null(home.Parameters);
- next = Assert.Single(home.Literals);
- Assert.Equal("view-all", next.Key);
- var index = next.Value;
- Assert.Same(endpoint, Assert.Single(index.Matches));
- Assert.Null(index.Literals);
- }
- [Fact]
- public void BuildDfaTree_RequiredValues_AndDefaults_AndParameterTransformer()
- {
- // Arrange
- var builder = CreateDfaMatcherBuilder();
- var endpoint = CreateEndpoint(
- "ConventionalTransformerRoute/{controller:slugify}/{action=Index}/{param:slugify?}",
- requiredValues: new { controller = "ConventionalTransformer", action = "Index", area = (string)null, page = (string)null });
- builder.AddEndpoint(endpoint);
- // Act
- var root = builder.BuildDfaTree();
- // Assert
- Assert.Null(root.Matches);
- Assert.Null(root.Parameters);
- var next = Assert.Single(root.Literals);
- Assert.Equal("ConventionalTransformerRoute", next.Key);
- var conventionalTransformerRoute = next.Value;
- Assert.Null(conventionalTransformerRoute.Matches);
- Assert.Null(conventionalTransformerRoute.Parameters);
- next = Assert.Single(conventionalTransformerRoute.Literals);
- Assert.Equal("conventional-transformer", next.Key);
- var conventionalTransformer = next.Value;
- Assert.Same(endpoint, Assert.Single(conventionalTransformer.Matches));
- next = Assert.Single(conventionalTransformer.Literals);
- Assert.Equal("Index", next.Key);
- var index = next.Value;
- Assert.Same(endpoint, Assert.Single(index.Matches));
- Assert.NotNull(index.Parameters);
- Assert.Same(endpoint, Assert.Single(index.Parameters.Matches));
- }
- [Fact]
- public void CreateCandidate_JustLiterals()
- {
- // Arrange
- var endpoint = CreateEndpoint("/a/b/c");
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(Candidate.CandidateFlags.None, candidate.Flags);
- Assert.Empty(candidate.Slots);
- Assert.Empty(candidate.Captures);
- Assert.Equal(default, candidate.CatchAll);
- Assert.Empty(candidate.ComplexSegments);
- Assert.Empty(candidate.Constraints);
- }
- [Fact]
- public void CreateCandidate_Parameters()
- {
- // Arrange
- var endpoint = CreateEndpoint("/{a}/{b}/{c}");
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(Candidate.CandidateFlags.HasCaptures, candidate.Flags);
- Assert.Equal(3, candidate.Slots.Length);
- Assert.Collection(
- candidate.Captures,
- c => Assert.Equal(("a", 0, 0), c),
- c => Assert.Equal(("b", 1, 1), c),
- c => Assert.Equal(("c", 2, 2), c));
- Assert.Equal(default, candidate.CatchAll);
- Assert.Empty(candidate.ComplexSegments);
- Assert.Empty(candidate.Constraints);
- }
- [Fact]
- public void CreateCandidate_Parameters_WithDefaults()
- {
- // Arrange
- var endpoint = CreateEndpoint("/{a=aa}/{b=bb}/{c=cc}");
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(
- Candidate.CandidateFlags.HasDefaults | Candidate.CandidateFlags.HasCaptures,
- candidate.Flags);
- Assert.Collection(
- candidate.Slots,
- s => Assert.Equal(new KeyValuePair<string, object>("a", "aa"), s),
- s => Assert.Equal(new KeyValuePair<string, object>("b", "bb"), s),
- s => Assert.Equal(new KeyValuePair<string, object>("c", "cc"), s));
- Assert.Collection(
- candidate.Captures,
- c => Assert.Equal(("a", 0, 0), c),
- c => Assert.Equal(("b", 1, 1), c),
- c => Assert.Equal(("c", 2, 2), c));
- Assert.Equal(default, candidate.CatchAll);
- Assert.Empty(candidate.ComplexSegments);
- Assert.Empty(candidate.Constraints);
- }
- [Fact]
- public void CreateCandidate_Parameters_CatchAll()
- {
- // Arrange
- var endpoint = CreateEndpoint("/{a}/{b}/{*c=cc}");
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(
- Candidate.CandidateFlags.HasDefaults |
- Candidate.CandidateFlags.HasCaptures |
- Candidate.CandidateFlags.HasCatchAll,
- candidate.Flags);
- Assert.Collection(
- candidate.Slots,
- s => Assert.Equal(new KeyValuePair<string, object>("c", "cc"), s),
- s => Assert.Equal(new KeyValuePair<string, object>(null, null), s),
- s => Assert.Equal(new KeyValuePair<string, object>(null, null), s));
- Assert.Collection(
- candidate.Captures,
- c => Assert.Equal(("a", 0, 1), c),
- c => Assert.Equal(("b", 1, 2), c));
- Assert.Equal(("c", 2, 0), candidate.CatchAll);
- Assert.Empty(candidate.ComplexSegments);
- Assert.Empty(candidate.Constraints);
- }
- // Defaults are processed first, which affects the slot ordering.
- [Fact]
- public void CreateCandidate_Parameters_OutOfLineDefaults()
- {
- // Arrange
- var endpoint = CreateEndpoint("/{a}/{b}/{c=cc}", new { a = "aa", d = "dd", });
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(
- Candidate.CandidateFlags.HasDefaults | Candidate.CandidateFlags.HasCaptures,
- candidate.Flags);
- Assert.Collection(
- candidate.Slots,
- s => Assert.Equal(new KeyValuePair<string, object>("a", "aa"), s),
- s => Assert.Equal(new KeyValuePair<string, object>("d", "dd"), s),
- s => Assert.Equal(new KeyValuePair<string, object>("c", "cc"), s),
- s => Assert.Equal(new KeyValuePair<string, object>(null, null), s));
- Assert.Collection(
- candidate.Captures,
- c => Assert.Equal(("a", 0, 0), c),
- c => Assert.Equal(("b", 1, 3), c),
- c => Assert.Equal(("c", 2, 2), c));
- Assert.Equal(default, candidate.CatchAll);
- Assert.Empty(candidate.ComplexSegments);
- Assert.Empty(candidate.Constraints);
- }
- [Fact]
- public void CreateCandidate_Parameters_ComplexSegments()
- {
- // Arrange
- var endpoint = CreateEndpoint("/{a}-{b=bb}/{c}");
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(
- Candidate.CandidateFlags.HasDefaults |
- Candidate.CandidateFlags.HasCaptures |
- Candidate.CandidateFlags.HasComplexSegments,
- candidate.Flags);
- Assert.Collection(
- candidate.Slots,
- s => Assert.Equal(new KeyValuePair<string, object>("b", "bb"), s),
- s => Assert.Equal(new KeyValuePair<string, object>(null, null), s));
- Assert.Collection(
- candidate.Captures,
- c => Assert.Equal(("c", 1, 1), c));
- Assert.Equal(default, candidate.CatchAll);
- Assert.Collection(
- candidate.ComplexSegments,
- s => Assert.Equal(0, s.segmentIndex));
- Assert.Empty(candidate.Constraints);
- }
- [Fact]
- public void CreateCandidate_RouteConstraints()
- {
- // Arrange
- var endpoint = CreateEndpoint("/a/b/c", constraints: new { a = new IntRouteConstraint(), });
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(Candidate.CandidateFlags.HasConstraints, candidate.Flags);
- Assert.Empty(candidate.Slots);
- Assert.Empty(candidate.Captures);
- Assert.Equal(default, candidate.CatchAll);
- Assert.Empty(candidate.ComplexSegments);
- Assert.Single(candidate.Constraints);
- }
- [Fact]
- public void CreateCandidate_CustomParameterPolicy()
- {
- // Arrange
- var endpoint = CreateEndpoint("/a/b/c", constraints: new { a = new CustomParameterPolicy(), });
- var builder = CreateDfaMatcherBuilder();
- // Act
- var candidate = builder.CreateCandidate(endpoint, score: 0);
- // Assert
- Assert.Equal(Candidate.CandidateFlags.None, candidate.Flags);
- Assert.Empty(candidate.Slots);
- Assert.Empty(candidate.Captures);
- Assert.Equal(default, candidate.CatchAll);
- Assert.Empty(candidate.ComplexSegments);
- Assert.Empty(candidate.Constraints);
- }
- private class CustomParameterPolicy : IParameterPolicy
- {
- }
- [Fact]
- public void CreateCandidates_CreatesScoresCorrectly()
- {
- // Arrange
- var endpoints = new[]
- {
- CreateEndpoint("/a/b/c", constraints: new { a = new IntRouteConstraint(), }, metadata: new object[] { new TestMetadata1(), new TestMetadata2(), }),
- CreateEndpoint("/a/b/c", constraints: new { a = new AlphaRouteConstraint(), }, metadata: new object[] { new TestMetadata1(), new TestMetadata2(), }),
- CreateEndpoint("/a/b/c", constraints: new { a = new IntRouteConstraint(), }, metadata: new object[] { new TestMetadata1(), }),
- CreateEndpoint("/a/b/c", constraints: new { a = new IntRouteConstraint(), }, metadata: new object[] { new TestMetadata2(), }),
- CreateEndpoint("/a/b/c", constraints: new { }, metadata: new object[] { }),
- CreateEndpoint("/a/b/c", constraints: new { }, metadata: new object[] { }),
- };
- var builder = CreateDfaMatcherBuilder(new TestMetadata1MatcherPolicy(), new TestMetadata2MatcherPolicy());
- // Act
- var candidates = builder.CreateCandidates(endpoints);
- // Assert
- Assert.Collection(
- candidates,
- c => Assert.Equal(0, c.Score),
- c => Assert.Equal(0, c.Score),
- c => Assert.Equal(1, c.Score),
- c => Assert.Equal(2, c.Score),
- c => Assert.Equal(3, c.Score),
- c => Assert.Equal(3, c.Score));
- }
- private static DfaMatcherBuilder CreateDfaMatcherBuilder(params MatcherPolicy[] policies)
- {
- var policyFactory = CreateParameterPolicyFactory();
- var dataSource = new CompositeEndpointDataSource(Array.Empty<EndpointDataSource>());
- return new DfaMatcherBuilder(
- NullLoggerFactory.Instance,
- policyFactory,
- Mock.Of<EndpointSelector>(),
- policies);
- }
- private static RouteEndpoint CreateSubsitutedEndpoint(
- string template,
- object defaults = null,
- object constraints = null,
- object requiredValues = null,
- params object[] metadata)
- {
- var routePattern = RoutePatternFactory.Parse(template, defaults, constraints);
- var policyFactory = CreateParameterPolicyFactory();
- var defaultRoutePatternTransformer = new DefaultRoutePatternTransformer(policyFactory);
- routePattern = defaultRoutePatternTransformer.SubstituteRequiredValues(routePattern, requiredValues);
- return EndpointFactory.CreateRouteEndpoint(routePattern, metadata: metadata);
- }
- public static RoutePattern CreateRoutePattern(RoutePattern routePattern, object requiredValues)
- {
- if (requiredValues != null)
- {
- var policyFactory = CreateParameterPolicyFactory();
- var defaultRoutePatternTransformer = new DefaultRoutePatternTransformer(policyFactory);
- routePattern = defaultRoutePatternTransformer.SubstituteRequiredValues(routePattern, requiredValues);
- }
- return routePattern;
- }
- private static DefaultParameterPolicyFactory CreateParameterPolicyFactory()
- {
- var serviceCollection = new ServiceCollection();
- var policyFactory = new DefaultParameterPolicyFactory(
- Options.Create(new RouteOptions
- {
- ConstraintMap =
- {
- ["slugify"] = typeof(SlugifyParameterTransformer),
- ["upper-case"] = typeof(UpperCaseParameterTransform)
- }
- }),
- serviceCollection.BuildServiceProvider());
- return policyFactory;
- }
- private static RouteEndpoint CreateEndpoint(
- string template,
- object defaults = null,
- object constraints = null,
- object requiredValues = null,
- int order = 0,
- params object[] metadata)
- {
- return EndpointFactory.CreateRouteEndpoint(template, defaults, constraints, requiredValues, order: order, metadata: metadata);
- }
- private class TestMetadata1
- {
- public TestMetadata1()
- {
- }
- public TestMetadata1(int state)
- {
- State = state;
- }
- public int State { get; set; }
- }
- private class TestMetadata1MatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, INodeBuilderPolicy
- {
- public override int Order => 100;
- public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata1>.Default;
- public Action<IReadOnlyList<Endpoint>> OnGetEdges { get; set; }
- public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints)
- {
- return endpoints.Any(e => e.Metadata.GetMetadata<TestMetadata1>() != null);
- }
- public PolicyJumpTable BuildJumpTable(int exitDestination, IReadOnlyList<PolicyJumpTableEdge> edges)
- {
- throw new NotImplementedException();
- }
- public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints)
- {
- OnGetEdges?.Invoke(endpoints);
- return endpoints
- .GroupBy(e => e.Metadata.GetMetadata<TestMetadata1>().State)
- .Select(g => new PolicyNodeEdge(g.Key, g.ToArray()))
- .ToArray();
- }
- }
- private class TestMetadata2
- {
- public TestMetadata2()
- {
- }
- public TestMetadata2(bool state)
- {
- State = state;
- }
- public bool State { get; set; }
- }
- private class TestMetadata2MatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, INodeBuilderPolicy
- {
- public override int Order => 101;
- public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata2>.Default;
- public Action<IReadOnlyList<Endpoint>> OnGetEdges { get; set; }
- public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints)
- {
- return endpoints.Any(e => e.Metadata.GetMetadata<TestMetadata2>() != null);
- }
- public PolicyJumpTable BuildJumpTable(int exitDestination, IReadOnlyList<PolicyJumpTableEdge> edges)
- {
- throw new NotImplementedException();
- }
- public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints)
- {
- OnGetEdges?.Invoke(endpoints);
- return endpoints
- .GroupBy(e => e.Metadata.GetMetadata<TestMetadata2>().State)
- .Select(g => new PolicyNodeEdge(g.Key, g.ToArray()))
- .ToArray();
- }
- }
- private class TestNonRoutePatternMatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, INodeBuilderPolicy
- {
- public override int Order => 100;
- public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata1>.Default;
- public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints)
- {
- return endpoints.Any(e => e.Metadata.GetMetadata<TestMetadata1>() != null);
- }
- public PolicyJumpTable BuildJumpTable(int exitDestination, IReadOnlyList<PolicyJumpTableEdge> edges)
- {
- throw new NotImplementedException();
- }
- public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints)
- {
- var edges = endpoints
- .GroupBy(e => e.Metadata.GetMetadata<TestMetadata1>().State)
- .Select(g => new PolicyNodeEdge(g.Key, g.ToArray()))
- .ToList();
- var maxValueEndpoint = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "MaxValueEndpoint");
- edges.Add(new PolicyNodeEdge(int.MaxValue, new[] { maxValueEndpoint }));
- return edges;
- }
- }
- }
|