diff --git a/.gitignore b/.gitignore index ce2d3db..b9c24f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ node_modules/* .vscode/ -package-lock.json -package.json +generated/ +example/*.yaml +example/*.yml +Postman_files \ No newline at end of file diff --git a/LICENSE b/LICENSE index c8fb052..3392e20 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,20 @@ +For copyright information, please see the COPYRIGHT file. + +Odoo is published under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3 +(LGPLv3), as included below. Since the LGPL is a set of additional +permissions on top of the GPL, the text of the GPL is included at the +bottom as well. + +Some external libraries and contributions bundled with Odoo may be published +under other GPL-compatible licenses. For these, please refer to the relevant +source files and/or license files, in the source code tree. + +************************************************************************** GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -164,3 +176,683 @@ whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. + +************************************************************************** + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + + +************************************************************************** \ No newline at end of file diff --git a/docs/README_ES.md b/docs/README_ES.md index e0ad43c..36bafa1 100644 --- a/docs/README_ES.md +++ b/docs/README_ES.md @@ -1,6 +1,6 @@ -# Openapi2postman +# swagger2postman -Openapi2postman genera una colección y un entorno Postman a partir de un archivo de definición OpenApi v. 2.0 (AKA swagger). Dicha colección incluye tests para respuestas 2xx, 400, 401 y 404. +swagger2postman genera una colección y un entorno Postman a partir de un archivo de definición OpenApi v. 2.0 (AKA swagger). Dicha colección incluye tests para respuestas 2xx, 400, 401 y 404. ![image1.png](images/image1.png) @@ -42,7 +42,7 @@ También puede probarse enviando parámetros de tipo erróneo (distinto al defin ## Archivo de configuración Es posible configurar la ejecución de la herramienta para que genere las colecciones y entornos que se deseen, eligiendo el nombre de los archivos, la ubicación dónde se dejarán los resultados, el tipo de peticiones que se pueden realizar, etc. Dicha configuración se establece de forma individualizada para cada colección y entorno. Puede consultarse la definición y ejemplos de dicho archivo de configuración en el siguiente documento: -[Archivo de configuración openapi2postman](./docs/openapi2postman-Archivo_de_configuracion.pdf) +[Archivo de configuración swagger2postman](./docs/MD-swagger2postman-Archivo_de_configuracion.pdf) En la estructura de archivos se incluye un archivo de configuración que puede tomarse como ejemplo. diff --git a/docs/start_guide.md b/docs/start_guide.md index 4797e8e..469182c 100644 --- a/docs/start_guide.md +++ b/docs/start_guide.md @@ -12,7 +12,7 @@ In all cases the status is checked and it is verified that the scheme of the out ![image2.png](images/image2.png) -Openapi2postman also generates a file of type environment with all the variables of both the bodies and the paths. These variables are used by the collection of postman generated to compose their bodies and their paths. +swagger2postman also generates a file of type environment with all the variables of both the bodies and the paths. These variables are used by the collection of postman generated to compose their bodies and their paths. ![image3.png](images/image3.png) diff --git a/docs/startguide_ES.md b/docs/startguide_ES.md index e0ad43c..36bafa1 100644 --- a/docs/startguide_ES.md +++ b/docs/startguide_ES.md @@ -1,6 +1,6 @@ -# Openapi2postman +# swagger2postman -Openapi2postman genera una colección y un entorno Postman a partir de un archivo de definición OpenApi v. 2.0 (AKA swagger). Dicha colección incluye tests para respuestas 2xx, 400, 401 y 404. +swagger2postman genera una colección y un entorno Postman a partir de un archivo de definición OpenApi v. 2.0 (AKA swagger). Dicha colección incluye tests para respuestas 2xx, 400, 401 y 404. ![image1.png](images/image1.png) @@ -42,7 +42,7 @@ También puede probarse enviando parámetros de tipo erróneo (distinto al defin ## Archivo de configuración Es posible configurar la ejecución de la herramienta para que genere las colecciones y entornos que se deseen, eligiendo el nombre de los archivos, la ubicación dónde se dejarán los resultados, el tipo de peticiones que se pueden realizar, etc. Dicha configuración se establece de forma individualizada para cada colección y entorno. Puede consultarse la definición y ejemplos de dicho archivo de configuración en el siguiente documento: -[Archivo de configuración openapi2postman](./docs/openapi2postman-Archivo_de_configuracion.pdf) +[Archivo de configuración swagger2postman](./docs/MD-swagger2postman-Archivo_de_configuracion.pdf) En la estructura de archivos se incluye un archivo de configuración que puede tomarse como ejemplo. diff --git "a/docs/swager2postman-Gu\303\255a de usuario.pdf" "b/docs/swager2postman-Gu\303\255a de usuario.pdf" new file mode 100644 index 0000000..ea6394f Binary files /dev/null and "b/docs/swager2postman-Gu\303\255a de usuario.pdf" differ diff --git a/docs/swagger2postman-Archivo_de_configuracion.pdf b/docs/swagger2postman-Archivo_de_configuracion.pdf new file mode 100644 index 0000000..9ee70f4 Binary files /dev/null and b/docs/swagger2postman-Archivo_de_configuracion.pdf differ diff --git a/example/SWAGGER_API_TestSuiteEnv_DEV.postman_environment.json b/example/SWAGGER_API_TestSuiteEnv_DEV.postman_environment.json index 416f258..f0ebf07 100644 --- a/example/SWAGGER_API_TestSuiteEnv_DEV.postman_environment.json +++ b/example/SWAGGER_API_TestSuiteEnv_DEV.postman_environment.json @@ -1,205 +1 @@ -{ - "id": "10a413ae-b106-43fe-9cc5-8481250a4bfe", - "name": "SWAGGER_API_TestSuiteEnv_DEV", - "values": [ - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.001.001.clubname", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.001.002.idClub", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.001.002.idRegion", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.002.001.Region", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.002.001.idRegion", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.002.002.Region", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.002.002.idRegion", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.002.004.idRegion", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.003.001.Team", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.001.idCategory", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.001.idClub", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.001.idRegion", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.001.idSeason", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.001.idTeam", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.002.idClub", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.002.idTeam", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.004.001.idAwayTeam", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.004.001.idHomeTeam", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.004.001.season", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "basePath", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "petstore.swagger.io", - "key": "host", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": ":443", - "key": "port", - "enabled": true - } - ], - "_postman_variable_scope": "environment" -} \ No newline at end of file +{"id":"10a413ae-b106-43fe-9cc5-8481250a4bfe","name":"SWAGGER_API_TestSuiteEnv_DEV","values":[{"description":{"content":"","type":"text/plain"},"key":"basePath","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"petstore.swagger.io","key":"host","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_delete_petId_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_petId","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_petId_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_status","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_tags","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_post_petId","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_category_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_id","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_id_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_name","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_name_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_photoUrls","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_photoUrls_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_status","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_status_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_put_tags_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":":443","key":"port","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_delete_orderId_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_get_orderId","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_get_orderId_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_complete","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_complete_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_id","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_id_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_petId","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_petId_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_quantity","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_quantity_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_shipDate","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_shipDate_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_status","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_post_status_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_delete_username_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_get_password","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_get_username","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_get_username_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_email","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_email_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_firstName","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_firstName_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_id","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_id_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_lastName","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_lastName_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_password","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_password_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_phone","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_phone_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_userStatus","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_userStatus_wrong","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_username","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_username_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_put_username_wrong","enabled":true}],"_postman_variable_scope":"environment"} \ No newline at end of file diff --git a/example/SWAGGER_API_TestSuiteEnv_PROD.postman_environment.json b/example/SWAGGER_API_TestSuiteEnv_PROD.postman_environment.json index 7dbf253..7ef0c3c 100644 --- a/example/SWAGGER_API_TestSuiteEnv_PROD.postman_environment.json +++ b/example/SWAGGER_API_TestSuiteEnv_PROD.postman_environment.json @@ -1,304 +1 @@ -{ - "id": "10a413ae-b106-43fe-9cc5-8481250a4bfe", - "name": "SWAGGER_API_TestSuiteEnv_PROD", - "values": [ - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.001.autologin_ticket", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.001.client_id", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.001.client_secret", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.002.client_id", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.002.client_secret", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.002.password_token", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.002.scope1", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.002.scope2", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.002.scope_n", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.002.username_token", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.003.client_id", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.003.client_secret", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.003.password_token", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.003.username_token", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.004.client_id", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.004.client_secret", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.004.scope1", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.004.scope2", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.004.scope_n", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.005.client_id", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "TC.001.005.client_secret", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.002.001.clubname", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.002.002.idClub", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.002.002.idRegion", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.003.002.idRegion", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.004.001.idClub", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": 6, - "key": "TC.004.001.idTeam", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.005.001.idAwayTeam", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.005.001.idHomeTeam", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "goodstring", - "key": "TC.005.001.season", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "", - "key": "basePath", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "petstore.swagger.io", - "key": "host", - "enabled": true - }, - { - "description": { - "content": "", - "type": "text/plain" - }, - "value": "443", - "key": "port", - "enabled": true - } - ], - "_postman_variable_scope": "environment" -} \ No newline at end of file +{"id":"10a413ae-b106-43fe-9cc5-8481250a4bfe","name":"SWAGGER_API_TestSuiteEnv_PROD","values":[{"description":{"content":"","type":"text/plain"},"value":"","key":"apiKey_token","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"autologin_ticket","enabled":true},{"description":{"content":"","type":"text/plain"},"key":"basePath","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"client_id","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"client_secret","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"petstore.swagger.io","key":"host","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"oauth2_token","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"password_token","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_petId","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_petId_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_status","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"pet_get_tags","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"443","key":"port","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"scope1","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"scope2","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"scope_n","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_get_orderId","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"store_get_orderId_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_get_password","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_get_username","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"user_get_username_not_found","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"","key":"username_token","enabled":true}],"_postman_variable_scope":"environment"} \ No newline at end of file diff --git a/example/SWAGGER_API_TestSuite_DEV.postman_collection.json b/example/SWAGGER_API_TestSuite_DEV.postman_collection.json index d678ff0..4e9058f 100644 --- a/example/SWAGGER_API_TestSuite_DEV.postman_collection.json +++ b/example/SWAGGER_API_TestSuite_DEV.postman_collection.json @@ -1 +1 @@ -{"info":{"_postman_id":"8680b1d9-579c-43d2-8035-991b269c31e0","name":"SWAGGER_API_TestSuite_DEV","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[{"name":"001.club","item":[{"name":"001.001.Returns a list of clubs","item":[{"name":"TC.001.001.200 Returns a list of clubs ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idClub":{"type":"integer","format":"int"},"Club":{"type":"string"},"Address":{"type":"string"},"Phone":{"type":"string"},"Email":{"type":"string"},"Web":{"type":"string"},"Responsible":{"type":"string"},"Logo":{"type":"string"},"Region":{"type":"integer","format":"int"}},"description":"CLUB MODEL"}},"authorization":false,"summary":"Returns a list of clubs","queryParams":[{"name":"clubname","type":"string"}],"pathParameter":false,"numerateItem":"TC.001.001."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/club","host":["{{host}}{{port}}{{basePath}}"],"path":["/club?clubname={{TC.001.001.clubname}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"Club\":{\"type\":\"string\"},\"Address\":{\"type\":\"string\"},\"Phone\":{\"type\":\"string\"},\"Email\":{\"type\":\"string\"},\"Web\":{\"type\":\"string\"},\"Responsible\":{\"type\":\"string\"},\"Logo\":{\"type\":\"string\"},\"Region\":{\"type\":\"integer\",\"format\":\"int\"}},\"description\":\"CLUB MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns a list of clubs","auxOrder":"GET","aux":{"numerateItem":"TC.001.001."}},{"name":"001.002.Return a Club with given ID","item":[{"name":"TC.001.002.200 Return a Club with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idClub":{"type":"integer","format":"int"},"Club":{"type":"string"},"Address":{"type":"string"},"Phone":{"type":"string"},"Email":{"type":"string"},"Web":{"type":"string"},"Responsible":{"type":"string"},"Logo":{"type":"string"},"Region":{"type":"integer","format":"int"}},"description":"CLUB MODEL"}},"authorization":false,"summary":"Return a Club with given ID","queryParams":[],"pathParameter":"idClub","numerateItem":"TC.001.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/club/{{TC.001.002.idClub}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/club/{{TC.001.002.idClub}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"Club\":{\"type\":\"string\"},\"Address\":{\"type\":\"string\"},\"Phone\":{\"type\":\"string\"},\"Email\":{\"type\":\"string\"},\"Web\":{\"type\":\"string\"},\"Responsible\":{\"type\":\"string\"},\"Logo\":{\"type\":\"string\"},\"Region\":{\"type\":\"integer\",\"format\":\"int\"}},\"description\":\"CLUB MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.001.002.200 Return a Club with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idClub":{"type":"integer","format":"int"},"Club":{"type":"string"},"Address":{"type":"string"},"Phone":{"type":"string"},"Email":{"type":"string"},"Web":{"type":"string"},"Responsible":{"type":"string"},"Logo":{"type":"string"},"Region":{"type":"integer","format":"int"}},"description":"CLUB MODEL"}},"authorization":false,"summary":"Return a Club with given ID","queryParams":[],"pathParameter":"idRegion","numerateItem":"TC.001.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/club/region/{{TC.001.002.idRegion}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/club/region/{{TC.001.002.idRegion}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"Club\":{\"type\":\"string\"},\"Address\":{\"type\":\"string\"},\"Phone\":{\"type\":\"string\"},\"Email\":{\"type\":\"string\"},\"Web\":{\"type\":\"string\"},\"Responsible\":{\"type\":\"string\"},\"Logo\":{\"type\":\"string\"},\"Region\":{\"type\":\"integer\",\"format\":\"int\"}},\"description\":\"CLUB MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Return a Club with given ID","auxOrder":"GET","aux":{"numerateItem":"TC.001.002."}}]},{"name":"002.region","item":[{"name":"002.001.Create a new Region","item":[{"name":"TC.002.001.201 Create a new Region ","aux":{"status":201,"body":{"type":"object","properties":{"idRegion":{"type":"integer","format":"int"},"Region":{"type":"string"}},"description":"REGION MODEL"},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Create a new Region","queryParams":[],"pathParameter":false,"numerateItem":"TC.002.001."},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"idRegion\": \"{{TC.002.001.idRegion}}\",\n \"Region\": \"{{TC.002.001.Region}}\"\n}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/region","host":["{{host}}{{port}}{{basePath}}"],"path":["/region"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 201\", function () {"," pm.response.to.have.status(201);","});"]}}]}],"auxName":"Create a new Region","auxOrder":"POST","aux":{"numerateItem":"TC.002.001."}},{"name":"002.002.Update an Region with given ID","item":[{"name":"TC.002.002.200 Update an Region with given ID ","aux":{"status":200,"body":{"type":"object","properties":{"idRegion":{"type":"integer","format":"int"},"Region":{"type":"string"}},"description":"REGION MODEL"},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"idRegion":{"type":"integer","format":"int"},"Region":{"type":"string"}},"description":"REGION MODEL"}},"authorization":false,"summary":"Update an Region with given ID","queryParams":[],"pathParameter":"idRegion","numerateItem":"TC.002.002."},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"idRegion\": \"{{TC.002.002.idRegion}}\",\n \"Region\": \"{{TC.002.002.Region}}\"\n}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/region/{{TC.002.002.idRegion}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/region/{{TC.002.002.idRegion}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Region\":{\"type\":\"string\"}},\"description\":\"REGION MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Update an Region with given ID","auxOrder":"PUT","aux":{"numerateItem":"TC.002.002."}},{"name":"002.003.Returns a list of regions.","item":[{"name":"TC.002.003.200 Returns a list of regions. ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idRegion":{"type":"integer","format":"int"},"Region":{"type":"string"}},"description":"REGION MODEL"}},"authorization":false,"summary":"Returns a list of regions.","queryParams":[],"pathParameter":false,"numerateItem":"TC.002.003."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/region","host":["{{host}}{{port}}{{basePath}}"],"path":["/region"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Region\":{\"type\":\"string\"}},\"description\":\"REGION MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns a list of regions.","auxOrder":"GET","aux":{"numerateItem":"TC.002.003."}},{"name":"002.004.Return an Region with given ID","item":[{"name":"TC.002.004.200 Return an Region with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idRegion":{"type":"integer","format":"int"},"Region":{"type":"string"}},"description":"REGION MODEL"}},"authorization":false,"summary":"Return an Region with given ID","queryParams":[],"pathParameter":"idRegion","numerateItem":"TC.002.004."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/region/{{TC.002.004.idRegion}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/region/{{TC.002.004.idRegion}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Region\":{\"type\":\"string\"}},\"description\":\"REGION MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Return an Region with given ID","auxOrder":"GET","aux":{"numerateItem":"TC.002.004."}}]},{"name":"003.team","item":[{"name":"003.001.Create a new Team","item":[{"name":"TC.003.001.201 Create a new Team ","aux":{"status":201,"body":{"type":"object","properties":{"idTeam":{"type":"integer","format":"int"},"idClub":{"type":"integer","format":"int"},"idSeason":{"type":"integer","format":"int"},"idCategory":{"type":"integer","format":"int"},"idRegion":{"type":"integer","format":"int"},"Team":{"type":"string","format":"int"}},"x-examples":{"example-1":{"idTeam":0,"idClub":0,"idSeason":0,"idCategory":0,"idRegion":0,"Team":"string"}},"description":"TEAM MODEL "},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Create a new Team","queryParams":[],"pathParameter":false,"numerateItem":"TC.003.001."},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"idTeam\": \"{{TC.003.001.idTeam}}\",\n \"idClub\": \"{{TC.003.001.idClub}}\",\n \"idSeason\": \"{{TC.003.001.idSeason}}\",\n \"idCategory\": \"{{TC.003.001.idCategory}}\",\n \"idRegion\": \"{{TC.003.001.idRegion}}\",\n \"Team\": \"{{TC.003.001.Team}}\"\n}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/team","host":["{{host}}{{port}}{{basePath}}"],"path":["/team"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 201\", function () {"," pm.response.to.have.status(201);","});"]}}]}],"auxName":"Create a new Team","auxOrder":"POST","aux":{"numerateItem":"TC.003.001."}},{"name":"003.002.Return a Team with given ID","item":[{"name":"TC.003.002.200 Return a Team with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idTeam":{"type":"integer","format":"int"},"idClub":{"type":"integer","format":"int"},"idSeason":{"type":"integer","format":"int"},"idCategory":{"type":"integer","format":"int"},"idRegion":{"type":"integer","format":"int"},"Team":{"type":"string","format":"int"}},"x-examples":{"example-1":{"idTeam":0,"idClub":0,"idSeason":0,"idCategory":0,"idRegion":0,"Team":"string"}},"description":"TEAM MODEL "}},"authorization":false,"summary":"Return a Team with given ID","queryParams":[],"pathParameter":"idClub","numerateItem":"TC.003.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/team/club/{{TC.003.002.idClub}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/team/club/{{TC.003.002.idClub}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idTeam\":{\"type\":\"integer\",\"format\":\"int\"},\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"idSeason\":{\"type\":\"integer\",\"format\":\"int\"},\"idCategory\":{\"type\":\"integer\",\"format\":\"int\"},\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Team\":{\"type\":\"string\",\"format\":\"int\"}},\"x-examples\":{\"example-1\":{\"idTeam\":0,\"idClub\":0,\"idSeason\":0,\"idCategory\":0,\"idRegion\":0,\"Team\":\"string\"}},\"description\":\"TEAM MODEL \"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.003.002.200 Return a Team with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idTeam":{"type":"integer","format":"int"},"idClub":{"type":"integer","format":"int"},"idSeason":{"type":"integer","format":"int"},"idCategory":{"type":"integer","format":"int"},"idRegion":{"type":"integer","format":"int"},"Team":{"type":"string","format":"int"}},"x-examples":{"example-1":{"idTeam":0,"idClub":0,"idSeason":0,"idCategory":0,"idRegion":0,"Team":"string"}},"description":"TEAM MODEL "}},"authorization":false,"summary":"Return a Team with given ID","queryParams":[],"pathParameter":"idTeam","numerateItem":"TC.003.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/team/{{TC.003.002.idTeam}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/team/{{TC.003.002.idTeam}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idTeam\":{\"type\":\"integer\",\"format\":\"int\"},\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"idSeason\":{\"type\":\"integer\",\"format\":\"int\"},\"idCategory\":{\"type\":\"integer\",\"format\":\"int\"},\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Team\":{\"type\":\"string\",\"format\":\"int\"}},\"x-examples\":{\"example-1\":{\"idTeam\":0,\"idClub\":0,\"idSeason\":0,\"idCategory\":0,\"idRegion\":0,\"Team\":\"string\"}},\"description\":\"TEAM MODEL \"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Return a Team with given ID","auxOrder":"GET","aux":{"numerateItem":"TC.003.002."}},{"name":"003.003.Returns a list of Teams.","item":[{"name":"TC.003.003.200 Returns a list of Teams. ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idTeam":{"type":"integer","format":"int"},"idClub":{"type":"integer","format":"int"},"idSeason":{"type":"integer","format":"int"},"idCategory":{"type":"integer","format":"int"},"idRegion":{"type":"integer","format":"int"},"Team":{"type":"string","format":"int"}},"x-examples":{"example-1":{"idTeam":0,"idClub":0,"idSeason":0,"idCategory":0,"idRegion":0,"Team":"string"}},"description":"TEAM MODEL "}},"authorization":false,"summary":"Returns a list of Teams.","queryParams":[],"pathParameter":false,"numerateItem":"TC.003.003."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/team","host":["{{host}}{{port}}{{basePath}}"],"path":["/team"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idTeam\":{\"type\":\"integer\",\"format\":\"int\"},\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"idSeason\":{\"type\":\"integer\",\"format\":\"int\"},\"idCategory\":{\"type\":\"integer\",\"format\":\"int\"},\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Team\":{\"type\":\"string\",\"format\":\"int\"}},\"x-examples\":{\"example-1\":{\"idTeam\":0,\"idClub\":0,\"idSeason\":0,\"idCategory\":0,\"idRegion\":0,\"Team\":\"string\"}},\"description\":\"TEAM MODEL \"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns a list of Teams.","auxOrder":"GET","aux":{"numerateItem":"TC.003.003."}}]},{"name":"004.scores","item":[{"name":"004.001.Get seasson match score","item":[{"name":"TC.004.001.200 Get seasson match score ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"HomeTeam":{"type":"object","properties":{"id":{"type":"integer","format":"int"},"name":{"type":"string"},"logo":{"type":"string"},"score":{"type":"integer","format":"int"}}},"AwayTeam":{"type":"object","properties":{"id":{"type":"integer","format":"int"},"name":{"type":"string"},"logo":{"type":"string"},"score":{"type":"integer","format":"int"}}},"Date":{"type":"string"},"Stadium":{"type":"string"},"Seasson":{"type":"string"},"Round":{"type":"string"},"Group":{"type":"string"},"Status":{"type":"string"},"LocalTeamId":{"type":"integer","format":"int"},"AwayTeamId":{"type":"integer","format":"int"},"id":{"type":"integer","format":"int"}}}},"authorization":false,"summary":"Get seasson match score","queryParams":[{"name":"idHomeTeam","type":"string","required":true},{"name":"idAwayTeam","type":"string","required":true},{"name":"season","type":"string"}],"pathParameter":false,"numerateItem":"TC.004.001."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/scores","host":["{{host}}{{port}}{{basePath}}"],"path":["/scores?idHomeTeam={{TC.004.001.idHomeTeam}}&idAwayTeam={{TC.004.001.idAwayTeam}}&season={{TC.004.001.season}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"HomeTeam\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int\"},\"name\":{\"type\":\"string\"},\"logo\":{\"type\":\"string\"},\"score\":{\"type\":\"integer\",\"format\":\"int\"}}},\"AwayTeam\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int\"},\"name\":{\"type\":\"string\"},\"logo\":{\"type\":\"string\"},\"score\":{\"type\":\"integer\",\"format\":\"int\"}}},\"Date\":{\"type\":\"string\"},\"Stadium\":{\"type\":\"string\"},\"Seasson\":{\"type\":\"string\"},\"Round\":{\"type\":\"string\"},\"Group\":{\"type\":\"string\"},\"Status\":{\"type\":\"string\"},\"LocalTeamId\":{\"type\":\"integer\",\"format\":\"int\"},\"AwayTeamId\":{\"type\":\"integer\",\"format\":\"int\"},\"id\":{\"type\":\"integer\",\"format\":\"int\"}}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Get seasson match score","auxOrder":"GET","aux":{"numerateItem":"TC.004.001."}}]}]} \ No newline at end of file +{"info":{"_postman_id":"8680b1d9-579c-43d2-8035-991b269c31e0","name":"SWAGGER_API_TestSuite_DEV","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[{"name":"001.pet","item":[{"name":"001.001.uploads an image","item":[{"name":"TC.001.001.200 uploads an image ","aux":{"status":"200","body":false,"consumes":"multipart/form-data","bodyResponse":{"200":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"type":{"type":"string"},"message":{"type":"string"}}}},"authorization":"oauth2_token","summary":"uploads an image","queryParams":[],"pathParameter":"petId"},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"multipart/form-data"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/{{pet_post_petId}}/uploadImage","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/{{pet_post_petId}}/uploadImage"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"type\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"}}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"uploads an image","auxOrder":"POST"},{"name":"001.002.Update an existing pet","item":[{"name":"TC.001.002.400 Update an existing pet without.name","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"without.name"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet without.photoUrls","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"without.photoUrls"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.id.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.id.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id_wrong}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.category.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.category.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":\"{{pet_put_category_wrong}}\",\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.category.id.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.category.id.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id_wrong}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.category.name.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.category.name.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name_wrong}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.name.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.name.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name_wrong}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.photoUrls.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.photoUrls.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":\"{{pet_put_photoUrls_wrong}}\",\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.tags.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.tags.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":\"{{pet_put_tags_wrong}}\",\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.tags.id.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.tags.id.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id_wrong}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.tags.name.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.tags.name.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name_wrong}}\"}],\"status\":\"{{pet_put_status}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.001.002.400 Update an existing pet with.status.wrong","aux":{"status":"400","body":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string","properties":{"type":"string"}}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"type":"object"},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}},"consumes":"application/json","bodyResponse":{},"authorization":"oauth2_token","summary":"Update an existing pet","queryParams":[],"pathParameter":false,"suffix":"with.status.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{pet_put_id}}\",\"category\":{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"},\"name\":\"{{pet_put_name}}\",\"photoUrls\":[\"{{pet_put_photoUrls}}\"],\"tags\":[{\"id\":\"{{pet_put_id}}\",\"name\":\"{{pet_put_name}}\"}],\"status\":\"{{pet_put_status_wrong}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Update an existing pet","auxOrder":"PUT"},{"name":"001.003.Finds Pets by status","item":[{"name":"TC.001.003.200 Finds Pets by status ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}}},"authorization":"oauth2_token","summary":"Finds Pets by status","queryParams":[{"prefix":"pet_get_","name":"status","type":"array","required":true}],"pathParameter":false},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByStatus","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByStatus?status={{pet_get_status}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\",\"photoUrls\"],\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"category\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Category\"}},\"name\":{\"type\":\"string\",\"example\":\"doggie\"},\"photoUrls\":{\"type\":\"array\",\"xml\":{\"name\":\"photoUrl\",\"wrapped\":true},\"items\":{\"type\":\"string\"}},\"tags\":{\"type\":\"array\",\"xml\":{\"name\":\"tag\",\"wrapped\":true},\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Tag\"}}},\"status\":{\"type\":\"string\",\"description\":\"pet status in the store\",\"enum\":[{\"0\":\"a\",\"1\":\"v\",\"2\":\"a\",\"3\":\"i\",\"4\":\"l\",\"5\":\"a\",\"6\":\"b\",\"7\":\"l\",\"8\":\"e\"},{\"0\":\"p\",\"1\":\"e\",\"2\":\"n\",\"3\":\"d\",\"4\":\"i\",\"5\":\"n\",\"6\":\"g\"},{\"0\":\"s\",\"1\":\"o\",\"2\":\"l\",\"3\":\"d\"}]}},\"xml\":{\"name\":\"Pet\"}}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.001.003.400 Finds Pets by status .without.status","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}}},"authorization":"oauth2_token","summary":"Finds Pets by status","queryParams":[{"prefix":"pet_get_","name":"status","type":"array","required":true}],"pathParameter":false,"suffix":".without.status"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByStatus","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByStatus"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Finds Pets by status","auxOrder":"GET"},{"name":"001.004.Finds Pets by tags","item":[{"name":"TC.001.004.200 Finds Pets by tags ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"string","description":"Circular REF solved swagger2postman"}}},"authorization":"oauth2_token","summary":"Finds Pets by tags","queryParams":[{"prefix":"pet_get_","name":"tags","type":"array","required":true}],"pathParameter":false},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByTags","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByTags?tags={{pet_get_tags}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"Circular REF solved swagger2postman\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.001.004.400 Finds Pets by tags .without.tags","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"string","description":"Circular REF solved swagger2postman"}}},"authorization":"oauth2_token","summary":"Finds Pets by tags","queryParams":[{"prefix":"pet_get_","name":"tags","type":"array","required":true}],"pathParameter":false,"suffix":".without.tags"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByTags","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByTags"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Finds Pets by tags","auxOrder":"GET"},{"name":"001.005.Find pet by ID","item":[{"name":"TC.001.005.200 Find pet by ID ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}},"authorization":"apiKey_token","summary":"Find pet by ID","queryParams":[],"pathParameter":"petId"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/{{pet_get_petId}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/{{pet_get_petId}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"required\":[\"name\",\"photoUrls\"],\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"category\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Category\"}},\"name\":{\"type\":\"string\",\"example\":\"doggie\"},\"photoUrls\":{\"type\":\"array\",\"xml\":{\"name\":\"photoUrl\",\"wrapped\":true},\"items\":{\"type\":\"string\"}},\"tags\":{\"type\":\"array\",\"xml\":{\"name\":\"tag\",\"wrapped\":true},\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Tag\"}}},\"status\":{\"type\":\"string\",\"description\":\"pet status in the store\",\"enum\":[{\"0\":\"a\",\"1\":\"v\",\"2\":\"a\",\"3\":\"i\",\"4\":\"l\",\"5\":\"a\",\"6\":\"b\",\"7\":\"l\",\"8\":\"e\"},{\"0\":\"p\",\"1\":\"e\",\"2\":\"n\",\"3\":\"d\",\"4\":\"i\",\"5\":\"n\",\"6\":\"g\"},{\"0\":\"s\",\"1\":\"o\",\"2\":\"l\",\"3\":\"d\"}]}},\"xml\":{\"name\":\"Pet\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.001.005.404 Find pet by ID ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}},"authorization":"apiKey_token","summary":"Find pet by ID","queryParams":[],"pathParameter":"petId"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/{{pet_get_petId_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/{{pet_get_petId_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Find pet by ID","auxOrder":"GET"},{"name":"001.006.Deletes a pet","item":[{"name":"TC.001.006.404 Deletes a pet ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{},"authorization":"oauth2_token","summary":"Deletes a pet","queryParams":[],"pathParameter":"petId"},"response":[],"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/{{pet_delete_petId_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/{{pet_delete_petId_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Deletes a pet","auxOrder":"DELETE"}]},{"name":"002.store","item":[{"name":"002.001.Place an order for a pet","item":[{"name":"TC.002.001.200 Place an order for a pet ","aux":{"status":"200","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Place an order for a pet","queryParams":[],"pathParameter":false},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{store_post_id}}\",\"petId\":\"{{store_post_petId}}\",\"quantity\":\"{{store_post_quantity}}\",\"shipDate\":\"{{store_post_shipDate}}\",\"status\":\"{{store_post_status}}\",\"complete\":\"{{store_post_complete}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"petId\":{\"type\":\"integer\",\"format\":\"int64\"},\"quantity\":{\"type\":\"integer\",\"format\":\"int32\"},\"shipDate\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"type\":\"string\",\"description\":\"Order Status\",\"enum\":[{\"0\":\"p\",\"1\":\"l\",\"2\":\"a\",\"3\":\"c\",\"4\":\"e\",\"5\":\"d\"},{\"0\":\"a\",\"1\":\"p\",\"2\":\"p\",\"3\":\"r\",\"4\":\"o\",\"5\":\"v\",\"6\":\"e\",\"7\":\"d\"},{\"0\":\"d\",\"1\":\"e\",\"2\":\"l\",\"3\":\"i\",\"4\":\"v\",\"5\":\"e\",\"6\":\"r\",\"7\":\"e\",\"8\":\"d\"}]},\"complete\":{\"type\":\"boolean\",\"default\":false}},\"xml\":{\"name\":\"Order\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.002.001.400 Place an order for a pet with.id.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Place an order for a pet","queryParams":[],"pathParameter":false,"suffix":"with.id.wrong"},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{store_post_id_wrong}}\",\"petId\":\"{{store_post_petId}}\",\"quantity\":\"{{store_post_quantity}}\",\"shipDate\":\"{{store_post_shipDate}}\",\"status\":\"{{store_post_status}}\",\"complete\":\"{{store_post_complete}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.002.001.400 Place an order for a pet with.petId.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Place an order for a pet","queryParams":[],"pathParameter":false,"suffix":"with.petId.wrong"},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{store_post_id}}\",\"petId\":\"{{store_post_petId_wrong}}\",\"quantity\":\"{{store_post_quantity}}\",\"shipDate\":\"{{store_post_shipDate}}\",\"status\":\"{{store_post_status}}\",\"complete\":\"{{store_post_complete}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.002.001.400 Place an order for a pet with.quantity.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Place an order for a pet","queryParams":[],"pathParameter":false,"suffix":"with.quantity.wrong"},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{store_post_id}}\",\"petId\":\"{{store_post_petId}}\",\"quantity\":\"{{store_post_quantity_wrong}}\",\"shipDate\":\"{{store_post_shipDate}}\",\"status\":\"{{store_post_status}}\",\"complete\":\"{{store_post_complete}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.002.001.400 Place an order for a pet with.shipDate.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Place an order for a pet","queryParams":[],"pathParameter":false,"suffix":"with.shipDate.wrong"},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{store_post_id}}\",\"petId\":\"{{store_post_petId}}\",\"quantity\":\"{{store_post_quantity}}\",\"shipDate\":\"{{store_post_shipDate_wrong}}\",\"status\":\"{{store_post_status}}\",\"complete\":\"{{store_post_complete}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.002.001.400 Place an order for a pet with.status.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Place an order for a pet","queryParams":[],"pathParameter":false,"suffix":"with.status.wrong"},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{store_post_id}}\",\"petId\":\"{{store_post_petId}}\",\"quantity\":\"{{store_post_quantity}}\",\"shipDate\":\"{{store_post_shipDate}}\",\"status\":\"{{store_post_status_wrong}}\",\"complete\":\"{{store_post_complete}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.002.001.400 Place an order for a pet with.complete.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}},"consumes":"application/json","bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Place an order for a pet","queryParams":[],"pathParameter":false,"suffix":"with.complete.wrong"},"response":[],"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{store_post_id}}\",\"petId\":\"{{store_post_petId}}\",\"quantity\":\"{{store_post_quantity}}\",\"shipDate\":\"{{store_post_shipDate}}\",\"status\":\"{{store_post_status}}\",\"complete\":\"{{store_post_complete_wrong}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Place an order for a pet","auxOrder":"POST"},{"name":"002.002.Returns pet inventories by status","item":[{"name":"TC.002.002.200 Returns pet inventories by status ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}}},"authorization":"apiKey_token","summary":"Returns pet inventories by status","queryParams":[],"pathParameter":false},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/inventory","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/inventory"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"additionalProperties\":{\"type\":\"integer\",\"format\":\"int32\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns pet inventories by status","auxOrder":"GET"},{"name":"002.003.Find purchase order by ID","item":[{"name":"TC.002.003.200 Find purchase order by ID ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Find purchase order by ID","queryParams":[],"pathParameter":"orderId"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order/{{store_get_orderId}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order/{{store_get_orderId}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"petId\":{\"type\":\"integer\",\"format\":\"int64\"},\"quantity\":{\"type\":\"integer\",\"format\":\"int32\"},\"shipDate\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"type\":\"string\",\"description\":\"Order Status\",\"enum\":[{\"0\":\"p\",\"1\":\"l\",\"2\":\"a\",\"3\":\"c\",\"4\":\"e\",\"5\":\"d\"},{\"0\":\"a\",\"1\":\"p\",\"2\":\"p\",\"3\":\"r\",\"4\":\"o\",\"5\":\"v\",\"6\":\"e\",\"7\":\"d\"},{\"0\":\"d\",\"1\":\"e\",\"2\":\"l\",\"3\":\"i\",\"4\":\"v\",\"5\":\"e\",\"6\":\"r\",\"7\":\"e\",\"8\":\"d\"}]},\"complete\":{\"type\":\"boolean\",\"default\":false}},\"xml\":{\"name\":\"Order\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.002.003.404 Find purchase order by ID ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Find purchase order by ID","queryParams":[],"pathParameter":"orderId"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order/{{store_get_orderId_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order/{{store_get_orderId_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Find purchase order by ID","auxOrder":"GET"},{"name":"002.004.Delete purchase order by ID","item":[{"name":"TC.002.004.404 Delete purchase order by ID ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{},"authorization":false,"summary":"Delete purchase order by ID","queryParams":[],"pathParameter":"orderId"},"response":[],"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order/{{store_delete_orderId_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order/{{store_delete_orderId_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Delete purchase order by ID","auxOrder":"DELETE"}]},{"name":"003.user","item":[{"name":"003.001.Updated user","item":[{"name":"TC.003.001.400 Updated user with.id.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.id.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id_wrong}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.400 Updated user with.username.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.username.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username_wrong}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.400 Updated user with.firstName.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.firstName.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName_wrong}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.400 Updated user with.lastName.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.lastName.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName_wrong}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.400 Updated user with.email.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.email.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email_wrong}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.400 Updated user with.password.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.password.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password_wrong}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.400 Updated user with.phone.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.phone.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone_wrong}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.400 Updated user with.userStatus.wrong","aux":{"status":"400","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username","suffix":"with.userStatus.wrong"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus_wrong}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.001.404 Updated user ","aux":{"status":"404","body":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}},"consumes":"application/json","bodyResponse":{},"authorization":false,"summary":"Updated user","queryParams":[],"pathParameter":"username"},"response":[],"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"id\":\"{{user_put_id}}\",\"username\":\"{{user_put_username}}\",\"firstName\":\"{{user_put_firstName}}\",\"lastName\":\"{{user_put_lastName}}\",\"email\":\"{{user_put_email}}\",\"password\":\"{{user_put_password}}\",\"phone\":\"{{user_put_phone}}\",\"userStatus\":\"{{user_put_userStatus}}\"}"},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_put_username_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_put_username_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Updated user","auxOrder":"PUT"},{"name":"003.002.Logs user into the system","item":[{"name":"TC.003.002.200 Logs user into the system ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"string"}},"authorization":false,"summary":"Logs user into the system","queryParams":[{"prefix":"user_get_","name":"username","type":"string","required":true},{"prefix":"user_get_","name":"password","type":"string","required":true}],"pathParameter":false},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/login","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/login?username={{user_get_username}}&password={{user_get_password}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"string\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.003.002.400 Logs user into the system .without.username","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"string"}},"authorization":false,"summary":"Logs user into the system","queryParams":[{"prefix":"user_get_","name":"username","type":"string","required":true},{"prefix":"user_get_","name":"password","type":"string","required":true}],"pathParameter":false,"suffix":".without.username"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/login","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/login?password={{user_get_password}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.003.002.400 Logs user into the system .without.password","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"string"}},"authorization":false,"summary":"Logs user into the system","queryParams":[{"prefix":"user_get_","name":"username","type":"string","required":true},{"prefix":"user_get_","name":"password","type":"string","required":true}],"pathParameter":false,"suffix":".without.password"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/login","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/login?username={{user_get_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Logs user into the system","auxOrder":"GET"},{"name":"003.003.Get user by user name","item":[{"name":"TC.003.003.200 Get user by user name ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}}},"authorization":false,"summary":"Get user by user name","queryParams":[],"pathParameter":"username"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_get_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_get_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"username\":{\"type\":\"string\"},\"firstName\":{\"type\":\"string\"},\"lastName\":{\"type\":\"string\"},\"email\":{\"type\":\"string\"},\"password\":{\"type\":\"string\"},\"phone\":{\"type\":\"string\"},\"userStatus\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"User Status\"}},\"xml\":{\"name\":\"User\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.003.003.404 Get user by user name ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}}},"authorization":false,"summary":"Get user by user name","queryParams":[],"pathParameter":"username"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_get_username_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_get_username_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Get user by user name","auxOrder":"GET"},{"name":"003.004.Delete user","item":[{"name":"TC.003.004.404 Delete user ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{},"authorization":false,"summary":"Delete user","queryParams":[],"pathParameter":"username"},"response":[],"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_delete_username_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_delete_username_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Delete user","auxOrder":"DELETE"}]}]} \ No newline at end of file diff --git a/example/SWAGGER_API_TestSuite_PROD.postman_collection.json b/example/SWAGGER_API_TestSuite_PROD.postman_collection.json index 1b0f915..477a8d9 100644 --- a/example/SWAGGER_API_TestSuite_PROD.postman_collection.json +++ b/example/SWAGGER_API_TestSuite_PROD.postman_collection.json @@ -1 +1 @@ -{"info":{"_postman_id":"8680b1d9-579c-43d2-8035-991b269c31e0","name":"SWAGGER_API_TestSuite_PROD","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[{"name":"001.authorizations","item":[{"name":"001.001.Token con ticket de autologin","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"autologin_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{TC.001.001.client_secret}}","type":"string"},{"key":"username","value":"{{TC.001.001.client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"autologin-ticket","value":"{{TC.001.001.autologin_ticket}}","type":"text"},{"key":"grant_type","value":"autologin","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true,"aux":{"numerateItem":"TC.001.001."}},{"name":"001.002.Token de usuario con scopes","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"user_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{TC.001.002.client_secret}}","type":"string"},{"key":"username","value":"{{TC.001.002.client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"{{TC.001.002.username_token}}","type":"text"},{"key":"password","value":"{{TC.001.002.password_token}}","type":"text"},{"key":"grant_type","value":"password","type":"text"},{"key":"scope","value":"{{TC.001.002.scope1}} {{TC.001.002.scope2}} {{TC.001.002.scope_n}}","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true,"aux":{"numerateItem":"TC.001.002."}},{"name":"001.003.Token de usuario","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"user_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{TC.001.003.client_secret}}","type":"string"},{"key":"username","value":"{{TC.001.003.client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"{{TC.001.003.username_token}}","type":"text"},{"key":"password","value":"{{TC.001.003.password_token}}","type":"text"},{"key":"grant_type","value":"password","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true,"aux":{"numerateItem":"TC.001.003."}},{"name":"001.004.Token de aplicación con scopes","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"application_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{TC.001.004.client_secret}}","type":"string"},{"key":"username","value":"{{TC.001.004.client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"},{"key":"scope","value":"{{TC.001.004.scope1}} {{TC.001.004.scope2}} {{TC.001.004.scope_n}} ","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true,"aux":{"numerateItem":"TC.001.004."}},{"name":"001.005.Token de aplicación","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"application_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{TC.001.005.client_secret}}","type":"string"},{"key":"username","value":"{{TC.001.005.client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true,"aux":{"numerateItem":"TC.001.005."}}]},{"name":"002.club","item":[{"name":"002.001.Returns a list of clubs","item":[{"name":"TC.002.001.200 Returns a list of clubs ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idClub":{"type":"integer","format":"int"},"Club":{"type":"string"},"Address":{"type":"string"},"Phone":{"type":"string"},"Email":{"type":"string"},"Web":{"type":"string"},"Responsible":{"type":"string"},"Logo":{"type":"string"},"Region":{"type":"integer","format":"int"}},"description":"CLUB MODEL"}},"authorization":false,"summary":"Returns a list of clubs","queryParams":[{"name":"clubname","type":"string"}],"pathParameter":false,"numerateItem":"TC.002.001."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/club","host":["{{host}}{{port}}{{basePath}}"],"path":["/club?clubname={{TC.002.001.clubname}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"Club\":{\"type\":\"string\"},\"Address\":{\"type\":\"string\"},\"Phone\":{\"type\":\"string\"},\"Email\":{\"type\":\"string\"},\"Web\":{\"type\":\"string\"},\"Responsible\":{\"type\":\"string\"},\"Logo\":{\"type\":\"string\"},\"Region\":{\"type\":\"integer\",\"format\":\"int\"}},\"description\":\"CLUB MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns a list of clubs","auxOrder":"GET","aux":{"numerateItem":"TC.002.001."}},{"name":"002.002.Return a Club with given ID","item":[{"name":"TC.002.002.200 Return a Club with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idClub":{"type":"integer","format":"int"},"Club":{"type":"string"},"Address":{"type":"string"},"Phone":{"type":"string"},"Email":{"type":"string"},"Web":{"type":"string"},"Responsible":{"type":"string"},"Logo":{"type":"string"},"Region":{"type":"integer","format":"int"}},"description":"CLUB MODEL"}},"authorization":false,"summary":"Return a Club with given ID","queryParams":[],"pathParameter":"idClub","numerateItem":"TC.002.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/club/{{TC.002.002.idClub}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/club/{{TC.002.002.idClub}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"Club\":{\"type\":\"string\"},\"Address\":{\"type\":\"string\"},\"Phone\":{\"type\":\"string\"},\"Email\":{\"type\":\"string\"},\"Web\":{\"type\":\"string\"},\"Responsible\":{\"type\":\"string\"},\"Logo\":{\"type\":\"string\"},\"Region\":{\"type\":\"integer\",\"format\":\"int\"}},\"description\":\"CLUB MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.002.002.200 Return a Club with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idClub":{"type":"integer","format":"int"},"Club":{"type":"string"},"Address":{"type":"string"},"Phone":{"type":"string"},"Email":{"type":"string"},"Web":{"type":"string"},"Responsible":{"type":"string"},"Logo":{"type":"string"},"Region":{"type":"integer","format":"int"}},"description":"CLUB MODEL"}},"authorization":false,"summary":"Return a Club with given ID","queryParams":[],"pathParameter":"idRegion","numerateItem":"TC.002.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/club/region/{{TC.002.002.idRegion}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/club/region/{{TC.002.002.idRegion}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"Club\":{\"type\":\"string\"},\"Address\":{\"type\":\"string\"},\"Phone\":{\"type\":\"string\"},\"Email\":{\"type\":\"string\"},\"Web\":{\"type\":\"string\"},\"Responsible\":{\"type\":\"string\"},\"Logo\":{\"type\":\"string\"},\"Region\":{\"type\":\"integer\",\"format\":\"int\"}},\"description\":\"CLUB MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Return a Club with given ID","auxOrder":"GET","aux":{"numerateItem":"TC.002.002."}}]},{"name":"003.region","item":[{"name":"003.001.Returns a list of regions.","item":[{"name":"TC.003.001.200 Returns a list of regions. ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idRegion":{"type":"integer","format":"int"},"Region":{"type":"string"}},"description":"REGION MODEL"}},"authorization":false,"summary":"Returns a list of regions.","queryParams":[],"pathParameter":false,"numerateItem":"TC.003.001."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/region","host":["{{host}}{{port}}{{basePath}}"],"path":["/region"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Region\":{\"type\":\"string\"}},\"description\":\"REGION MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns a list of regions.","auxOrder":"GET","aux":{"numerateItem":"TC.003.001."}},{"name":"003.002.Return an Region with given ID","item":[{"name":"TC.003.002.200 Return an Region with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idRegion":{"type":"integer","format":"int"},"Region":{"type":"string"}},"description":"REGION MODEL"}},"authorization":false,"summary":"Return an Region with given ID","queryParams":[],"pathParameter":"idRegion","numerateItem":"TC.003.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/region/{{TC.003.002.idRegion}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/region/{{TC.003.002.idRegion}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Region\":{\"type\":\"string\"}},\"description\":\"REGION MODEL\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Return an Region with given ID","auxOrder":"GET","aux":{"numerateItem":"TC.003.002."}}]},{"name":"004.team","item":[{"name":"004.001.Return a Team with given ID","item":[{"name":"TC.004.001.200 Return a Team with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idTeam":{"type":"integer","format":"int"},"idClub":{"type":"integer","format":"int"},"idSeason":{"type":"integer","format":"int"},"idCategory":{"type":"integer","format":"int"},"idRegion":{"type":"integer","format":"int"},"Team":{"type":"string","format":"int"}},"x-examples":{"example-1":{"idTeam":0,"idClub":0,"idSeason":0,"idCategory":0,"idRegion":0,"Team":"string"}},"description":"TEAM MODEL "}},"authorization":false,"summary":"Return a Team with given ID","queryParams":[],"pathParameter":"idClub","numerateItem":"TC.004.001."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/team/club/{{TC.004.001.idClub}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/team/club/{{TC.004.001.idClub}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idTeam\":{\"type\":\"integer\",\"format\":\"int\"},\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"idSeason\":{\"type\":\"integer\",\"format\":\"int\"},\"idCategory\":{\"type\":\"integer\",\"format\":\"int\"},\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Team\":{\"type\":\"string\",\"format\":\"int\"}},\"x-examples\":{\"example-1\":{\"idTeam\":0,\"idClub\":0,\"idSeason\":0,\"idCategory\":0,\"idRegion\":0,\"Team\":\"string\"}},\"description\":\"TEAM MODEL \"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.004.001.200 Return a Team with given ID ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idTeam":{"type":"integer","format":"int"},"idClub":{"type":"integer","format":"int"},"idSeason":{"type":"integer","format":"int"},"idCategory":{"type":"integer","format":"int"},"idRegion":{"type":"integer","format":"int"},"Team":{"type":"string","format":"int"}},"x-examples":{"example-1":{"idTeam":0,"idClub":0,"idSeason":0,"idCategory":0,"idRegion":0,"Team":"string"}},"description":"TEAM MODEL "}},"authorization":false,"summary":"Return a Team with given ID","queryParams":[],"pathParameter":"idTeam","numerateItem":"TC.004.001."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/team/{{TC.004.001.idTeam}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/team/{{TC.004.001.idTeam}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idTeam\":{\"type\":\"integer\",\"format\":\"int\"},\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"idSeason\":{\"type\":\"integer\",\"format\":\"int\"},\"idCategory\":{\"type\":\"integer\",\"format\":\"int\"},\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Team\":{\"type\":\"string\",\"format\":\"int\"}},\"x-examples\":{\"example-1\":{\"idTeam\":0,\"idClub\":0,\"idSeason\":0,\"idCategory\":0,\"idRegion\":0,\"Team\":\"string\"}},\"description\":\"TEAM MODEL \"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Return a Team with given ID","auxOrder":"GET","aux":{"numerateItem":"TC.004.001."}},{"name":"004.002.Returns a list of Teams.","item":[{"name":"TC.004.002.200 Returns a list of Teams. ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"idTeam":{"type":"integer","format":"int"},"idClub":{"type":"integer","format":"int"},"idSeason":{"type":"integer","format":"int"},"idCategory":{"type":"integer","format":"int"},"idRegion":{"type":"integer","format":"int"},"Team":{"type":"string","format":"int"}},"x-examples":{"example-1":{"idTeam":0,"idClub":0,"idSeason":0,"idCategory":0,"idRegion":0,"Team":"string"}},"description":"TEAM MODEL "}},"authorization":false,"summary":"Returns a list of Teams.","queryParams":[],"pathParameter":false,"numerateItem":"TC.004.002."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/team","host":["{{host}}{{port}}{{basePath}}"],"path":["/team"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"idTeam\":{\"type\":\"integer\",\"format\":\"int\"},\"idClub\":{\"type\":\"integer\",\"format\":\"int\"},\"idSeason\":{\"type\":\"integer\",\"format\":\"int\"},\"idCategory\":{\"type\":\"integer\",\"format\":\"int\"},\"idRegion\":{\"type\":\"integer\",\"format\":\"int\"},\"Team\":{\"type\":\"string\",\"format\":\"int\"}},\"x-examples\":{\"example-1\":{\"idTeam\":0,\"idClub\":0,\"idSeason\":0,\"idCategory\":0,\"idRegion\":0,\"Team\":\"string\"}},\"description\":\"TEAM MODEL \"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns a list of Teams.","auxOrder":"GET","aux":{"numerateItem":"TC.004.002."}}]},{"name":"005.scores","item":[{"name":"005.001.Get seasson match score","item":[{"name":"TC.005.001.200 Get seasson match score ","aux":{"status":200,"body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"HomeTeam":{"type":"object","properties":{"id":{"type":"integer","format":"int"},"name":{"type":"string"},"logo":{"type":"string"},"score":{"type":"integer","format":"int"}}},"AwayTeam":{"type":"object","properties":{"id":{"type":"integer","format":"int"},"name":{"type":"string"},"logo":{"type":"string"},"score":{"type":"integer","format":"int"}}},"Date":{"type":"string"},"Stadium":{"type":"string"},"Seasson":{"type":"string"},"Round":{"type":"string"},"Group":{"type":"string"},"Status":{"type":"string"},"LocalTeamId":{"type":"integer","format":"int"},"AwayTeamId":{"type":"integer","format":"int"},"id":{"type":"integer","format":"int"}}}},"authorization":false,"summary":"Get seasson match score","queryParams":[{"name":"idHomeTeam","type":"string","required":true},{"name":"idAwayTeam","type":"string","required":true},{"name":"season","type":"string"}],"pathParameter":false,"numerateItem":"TC.005.001."},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/scores","host":["{{host}}{{port}}{{basePath}}"],"path":["/scores?idHomeTeam={{TC.005.001.idHomeTeam}}&idAwayTeam={{TC.005.001.idAwayTeam}}&season={{TC.005.001.season}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"HomeTeam\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int\"},\"name\":{\"type\":\"string\"},\"logo\":{\"type\":\"string\"},\"score\":{\"type\":\"integer\",\"format\":\"int\"}}},\"AwayTeam\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int\"},\"name\":{\"type\":\"string\"},\"logo\":{\"type\":\"string\"},\"score\":{\"type\":\"integer\",\"format\":\"int\"}}},\"Date\":{\"type\":\"string\"},\"Stadium\":{\"type\":\"string\"},\"Seasson\":{\"type\":\"string\"},\"Round\":{\"type\":\"string\"},\"Group\":{\"type\":\"string\"},\"Status\":{\"type\":\"string\"},\"LocalTeamId\":{\"type\":\"integer\",\"format\":\"int\"},\"AwayTeamId\":{\"type\":\"integer\",\"format\":\"int\"},\"id\":{\"type\":\"integer\",\"format\":\"int\"}}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Get seasson match score","auxOrder":"GET","aux":{"numerateItem":"TC.005.001."}}]}]} \ No newline at end of file +{"info":{"_postman_id":"8680b1d9-579c-43d2-8035-991b269c31e0","name":"SWAGGER_API_TestSuite_PROD","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[{"name":"001.authorizations","item":[{"name":"001.001.Token con ticket de autologin","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"autologin_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{client_secret}}","type":"string"},{"key":"username","value":"{{client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"autologin-ticket","value":"{{autologin_ticket}}","type":"text"},{"key":"grant_type","value":"autologin","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true},{"name":"001.002.Token de usuario con scopes","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"user_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{client_secret}}","type":"string"},{"key":"username","value":"{{client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"{{username_token}}","type":"text"},{"key":"password","value":"{{password_token}}","type":"text"},{"key":"grant_type","value":"password","type":"text"},{"key":"scope","value":"{{scope1}} {{scope2}} {{scope_n}}","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true},{"name":"001.003.Token de usuario","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"user_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{client_secret}}","type":"string"},{"key":"username","value":"{{client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"{{username_token}}","type":"text"},{"key":"password","value":"{{password_token}}","type":"text"},{"key":"grant_type","value":"password","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true},{"name":"001.004.Token de aplicación con scopes","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"application_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{client_secret}}","type":"string"},{"key":"username","value":"{{client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"},{"key":"scope","value":"{{scope1}} {{scope2}} {{scope_n}} ","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true},{"name":"001.005.Token de aplicación","event":[{"listen":"test","script":{"id":"709a51c0-5c91-46ae-a1da-daa22d948b92","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var jsonData = JSON.parse(responseBody);","","postman.setEnvironmentVariable(\"application_token\", jsonData.access_token);"],"type":"text/javascript"}}],"request":{"auth":{"type":"basic","basic":[{"key":"password","value":"{{client_secret}}","type":"string"},{"key":"username","value":"{{client_id}}","type":"string"}]},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"}]},"url":{"raw":"{{host}}{{port}}/token","host":["{{host}}{{port}}"],"path":["token"]}},"response":[],"authType":true}]},{"name":"002.pet","item":[{"name":"002.001.Finds Pets by status","item":[{"name":"TC.002.001.200 Finds Pets by status ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}}},"authorization":"oauth2_token","summary":"Finds Pets by status","queryParams":[{"prefix":"pet_get_","name":"status","type":"array","required":true}],"pathParameter":false},"response":[],"request":{"method":"GET","header":[{"key":"Authorization","value":"{{oauth2_token}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByStatus","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByStatus?status={{pet_get_status}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\",\"photoUrls\"],\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"category\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Category\"}},\"name\":{\"type\":\"string\",\"example\":\"doggie\"},\"photoUrls\":{\"type\":\"array\",\"xml\":{\"name\":\"photoUrl\",\"wrapped\":true},\"items\":{\"type\":\"string\"}},\"tags\":{\"type\":\"array\",\"xml\":{\"name\":\"tag\",\"wrapped\":true},\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Tag\"}}},\"status\":{\"type\":\"string\",\"description\":\"pet status in the store\",\"enum\":[{\"0\":\"a\",\"1\":\"v\",\"2\":\"a\",\"3\":\"i\",\"4\":\"l\",\"5\":\"a\",\"6\":\"b\",\"7\":\"l\",\"8\":\"e\"},{\"0\":\"p\",\"1\":\"e\",\"2\":\"n\",\"3\":\"d\",\"4\":\"i\",\"5\":\"n\",\"6\":\"g\"},{\"0\":\"s\",\"1\":\"o\",\"2\":\"l\",\"3\":\"d\"}]}},\"xml\":{\"name\":\"Pet\"}}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.002.001.400 Finds Pets by status .without.status","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}}},"authorization":"oauth2_token","summary":"Finds Pets by status","queryParams":[{"prefix":"pet_get_","name":"status","type":"array","required":true}],"pathParameter":false,"suffix":".without.status"},"response":[],"request":{"method":"GET","header":[{"key":"Authorization","value":"{{oauth2_token}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByStatus","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByStatus"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Finds Pets by status","auxOrder":"GET"},{"name":"002.002.Finds Pets by tags","item":[{"name":"TC.002.002.200 Finds Pets by tags ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"string","description":"Circular REF solved swagger2postman"}}},"authorization":"oauth2_token","summary":"Finds Pets by tags","queryParams":[{"prefix":"pet_get_","name":"tags","type":"array","required":true}],"pathParameter":false},"response":[],"request":{"method":"GET","header":[{"key":"Authorization","value":"{{oauth2_token}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByTags","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByTags?tags={{pet_get_tags}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"Circular REF solved swagger2postman\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.002.002.400 Finds Pets by tags .without.tags","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"array","items":{"type":"string","description":"Circular REF solved swagger2postman"}}},"authorization":"oauth2_token","summary":"Finds Pets by tags","queryParams":[{"prefix":"pet_get_","name":"tags","type":"array","required":true}],"pathParameter":false,"suffix":".without.tags"},"response":[],"request":{"method":"GET","header":[{"key":"Authorization","value":"{{oauth2_token}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/findByTags","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/findByTags"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Finds Pets by tags","auxOrder":"GET"},{"name":"002.003.Find pet by ID","item":[{"name":"TC.002.003.200 Find pet by ID ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}},"authorization":"apiKey_token","summary":"Find pet by ID","queryParams":[],"pathParameter":"petId"},"response":[],"request":{"method":"GET","header":[{"key":"Authorization","value":"{{apiKey_token}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/{{pet_get_petId}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/{{pet_get_petId}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"required\":[\"name\",\"photoUrls\"],\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"category\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Category\"}},\"name\":{\"type\":\"string\",\"example\":\"doggie\"},\"photoUrls\":{\"type\":\"array\",\"xml\":{\"name\":\"photoUrl\",\"wrapped\":true},\"items\":{\"type\":\"string\"}},\"tags\":{\"type\":\"array\",\"xml\":{\"name\":\"tag\",\"wrapped\":true},\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"}},\"xml\":{\"name\":\"Tag\"}}},\"status\":{\"type\":\"string\",\"description\":\"pet status in the store\",\"enum\":[{\"0\":\"a\",\"1\":\"v\",\"2\":\"a\",\"3\":\"i\",\"4\":\"l\",\"5\":\"a\",\"6\":\"b\",\"7\":\"l\",\"8\":\"e\"},{\"0\":\"p\",\"1\":\"e\",\"2\":\"n\",\"3\":\"d\",\"4\":\"i\",\"5\":\"n\",\"6\":\"g\"},{\"0\":\"s\",\"1\":\"o\",\"2\":\"l\",\"3\":\"d\"}]}},\"xml\":{\"name\":\"Pet\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.002.003.404 Find pet by ID ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","enum":[{"0":"a","1":"v","2":"a","3":"i","4":"l","5":"a","6":"b","7":"l","8":"e"},{"0":"p","1":"e","2":"n","3":"d","4":"i","5":"n","6":"g"},{"0":"s","1":"o","2":"l","3":"d"}]}},"xml":{"name":"Pet"}}},"authorization":"apiKey_token","summary":"Find pet by ID","queryParams":[],"pathParameter":"petId"},"response":[],"request":{"method":"GET","header":[{"key":"Authorization","value":"{{apiKey_token}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/pet/{{pet_get_petId_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/pet/{{pet_get_petId_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Find pet by ID","auxOrder":"GET"}]},{"name":"003.store","item":[{"name":"003.001.Returns pet inventories by status","item":[{"name":"TC.003.001.200 Returns pet inventories by status ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}}},"authorization":"apiKey_token","summary":"Returns pet inventories by status","queryParams":[],"pathParameter":false},"response":[],"request":{"method":"GET","header":[{"key":"Authorization","value":"{{apiKey_token}}"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/inventory","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/inventory"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"additionalProperties\":{\"type\":\"integer\",\"format\":\"int32\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]}],"auxName":"Returns pet inventories by status","auxOrder":"GET"},{"name":"003.002.Find purchase order by ID","item":[{"name":"TC.003.002.200 Find purchase order by ID ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Find purchase order by ID","queryParams":[],"pathParameter":"orderId"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order/{{store_get_orderId}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order/{{store_get_orderId}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"petId\":{\"type\":\"integer\",\"format\":\"int64\"},\"quantity\":{\"type\":\"integer\",\"format\":\"int32\"},\"shipDate\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"type\":\"string\",\"description\":\"Order Status\",\"enum\":[{\"0\":\"p\",\"1\":\"l\",\"2\":\"a\",\"3\":\"c\",\"4\":\"e\",\"5\":\"d\"},{\"0\":\"a\",\"1\":\"p\",\"2\":\"p\",\"3\":\"r\",\"4\":\"o\",\"5\":\"v\",\"6\":\"e\",\"7\":\"d\"},{\"0\":\"d\",\"1\":\"e\",\"2\":\"l\",\"3\":\"i\",\"4\":\"v\",\"5\":\"e\",\"6\":\"r\",\"7\":\"e\",\"8\":\"d\"}]},\"complete\":{\"type\":\"boolean\",\"default\":false}},\"xml\":{\"name\":\"Order\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.003.002.404 Find purchase order by ID ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":[{"0":"p","1":"l","2":"a","3":"c","4":"e","5":"d"},{"0":"a","1":"p","2":"p","3":"r","4":"o","5":"v","6":"e","7":"d"},{"0":"d","1":"e","2":"l","3":"i","4":"v","5":"e","6":"r","7":"e","8":"d"}]},"complete":{"type":"boolean","default":false}},"xml":{"name":"Order"}}},"authorization":false,"summary":"Find purchase order by ID","queryParams":[],"pathParameter":"orderId"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/store/order/{{store_get_orderId_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/store/order/{{store_get_orderId_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Find purchase order by ID","auxOrder":"GET"}]},{"name":"004.user","item":[{"name":"004.001.Logs user into the system","item":[{"name":"TC.004.001.200 Logs user into the system ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"string"}},"authorization":false,"summary":"Logs user into the system","queryParams":[{"prefix":"user_get_","name":"username","type":"string","required":true},{"prefix":"user_get_","name":"password","type":"string","required":true}],"pathParameter":false},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/login","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/login?username={{user_get_username}}&password={{user_get_password}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"string\"};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.004.001.400 Logs user into the system .without.username","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"string"}},"authorization":false,"summary":"Logs user into the system","queryParams":[{"prefix":"user_get_","name":"username","type":"string","required":true},{"prefix":"user_get_","name":"password","type":"string","required":true}],"pathParameter":false,"suffix":".without.username"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/login","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/login?password={{user_get_password}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]},{"name":"TC.004.001.400 Logs user into the system .without.password","aux":{"status":"400","body":false,"consumes":false,"bodyResponse":{"200":{"type":"string"}},"authorization":false,"summary":"Logs user into the system","queryParams":[{"prefix":"user_get_","name":"username","type":"string","required":true},{"prefix":"user_get_","name":"password","type":"string","required":true}],"pathParameter":false,"suffix":".without.password"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/login","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/login?username={{user_get_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 400\", function () {"," pm.response.to.have.status(400);","});"]}}]}],"auxName":"Logs user into the system","auxOrder":"GET"},{"name":"004.002.Get user by user name","item":[{"name":"TC.004.002.200 Get user by user name ","aux":{"status":"200","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}}},"authorization":false,"summary":"Get user by user name","queryParams":[],"pathParameter":"username"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_get_username}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_get_username}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 200\", function () {"," pm.response.to.have.status(200);","});","","var json = JSON.parse(responseBody);","","var schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"username\":{\"type\":\"string\"},\"firstName\":{\"type\":\"string\"},\"lastName\":{\"type\":\"string\"},\"email\":{\"type\":\"string\"},\"password\":{\"type\":\"string\"},\"phone\":{\"type\":\"string\"},\"userStatus\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"User Status\"}},\"xml\":{\"name\":\"User\"}};","","pm.test('Schema is valid', function() {"," pm.expect(tv4.validate(json, schema)).to.be.true;","});"]}}]},{"name":"TC.004.002.404 Get user by user name ","aux":{"status":"404","body":false,"consumes":false,"bodyResponse":{"200":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}},"xml":{"name":"User"}}},"authorization":false,"summary":"Get user by user name","queryParams":[],"pathParameter":"username"},"response":[],"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{host}}{{port}}{{basePath}}/user/{{user_get_username_not_found}}","host":["{{host}}{{port}}{{basePath}}"],"path":["/user/{{user_get_username_not_found}}"]}},"event":[{"listen":"test","script":{"id":"63142ff5-28a4-40b2-8314-dcbeeaa89325","type":"text/javascript","exec":["pm.test(\"Status code is 404\", function () {"," pm.response.to.have.status(404);","});"]}}]}],"auxName":"Get user by user name","auxOrder":"GET"}]}]} \ No newline at end of file diff --git a/example/s2p_config_file.json b/example/s2p_config_file.json index d727d53..0b76c4b 100644 --- a/example/s2p_config_file.json +++ b/example/s2p_config_file.json @@ -1,37 +1,50 @@ { - "api_name" : "pestore_file", + "api_name" : "japi_rest_ejemplo_alumnos", + "is_inline": false, + "schema_is_inline": false, + "schema_pretty_print": true, "examples" : { "wrong" : { "string" : "badstring", "number" : -6, "boolean" : false, "object" : "badobject", - "array" : "badarray" + "array" : "badarray", + "date": "2020-40-40", + "date_time": "2020-40-40T00:00:00" }, "successful" : { "string" : "goodstring", "number" : 6, - "boolean" : true + "boolean" : true, + "date": "2020-01-01", + "date_time": "2020-01-01T23:59:59" } }, "environments":[ { "name" : "DEV", - "postman_collection_name": "SWAGGER_API_TestSuite_DEV", - "postman_environment_name": "SWAGGER_API_TestSuiteEnv_DEV", - "host": "petstore.swagger.io", + "postman_collection_name": "%api_name%_TestSuite_DEV", + "postman_environment_name": "%api_name%_TestSuiteEnv_DEV", + "host": "apis.comunidad.madrid", "port": ":443", - "target_folder": "example" + "target_folder": "pruebas", + "has_scopes": false, + "application_token": false, + "number_of_scopes": 0 }, { "name" : "PROD", - "postman_collection_name": "SWAGGER_API_TestSuite_PROD", - "postman_environment_name": "SWAGGER_API_TestSuiteEnv_PROD", - "host": "petstore.swagger.io", + "postman_collection_name": "%api_name%_TestSuite_PROD", + "postman_environment_name": "%api_name%_TestSuiteEnv_PROD", + "host": "apis.comunidad.madrid", "port": "443", "read_only": true, - "target_folder": "example", - "custom_authorizations_file": "authorizations.postman_collection.json" + "target_folder": "pruebas", + "custom_authorizations_file": "authorizations.postman_collection.json", + "has_scopes": false, + "application_token": true, + "number_of_scopes": 0 } ] } diff --git a/index.js b/index.js index 7259e77..64264f4 100644 --- a/index.js +++ b/index.js @@ -8,15 +8,17 @@ const fs = require('fs'); //PARSER-------------------------------- */ let configurationFile + try { configurationFile = JSON.parse(fs.readFileSync(argv.configuration, "utf8")) } catch(err) { - require('./src/utils/error.js')('Configuration file not exist or not is correct: ' + argv.configuration); + require('./src/utils/error.js')('configuration file does not exist or is not correct: ' + argv.configuration); } global.definition = require('./src/parser/definition.js')() const version = require('./src/parser/version.js')() global.environmentVariables = {} +global.testParams = {} global.configurationFile = configurationFile require('./src/parser/'+version+'/refs.js')() @@ -35,13 +37,12 @@ _.forEach(endpointsParsed, function (endpointParsed, i) { endpointsParsed[i].queryParams = require('./src/parser/'+version+'/queryParams.js')(endpointParsed.verb, endpointParsed.path) endpointsParsed[i].summary = require('./src/parser/summary.js')(endpointParsed.verb, endpointParsed.path) }); - //GENERATOR-------------------------------- */ -const endpointsPostman = []; +let endpointsPostman = []; const endpoints = require('./src/generator/endpoints.js')(endpointsParsed); _.forEach(endpoints, function (endpoint, i) { endpoint = require('./src/generator/testStatus.js')(endpoint); - endpoint = require('./src/generator/testBody.js')(endpoint); + endpoint = require('./src/generator/testBody.js')(endpoint, configurationFile); endpoint = require('./src/generator/contentType.js')(endpoint); endpoint = require('./src/generator/authorization.js')(endpoint, endpoint.aux.status) global.currentId = endpoint.request.method + endpoint.request.url.path[0] @@ -57,13 +58,25 @@ _.forEach(endpoints, function (endpoint, i) { let endpointPostman do{ endpointPostman = require('./src/generator/queryParamsRequired.js')(endpoint,true) - if (endpointPostman){ + if (endpointPostman) { endpointPostman = require('./src/generator/body.js')(endpointPostman) - endpointPostman.name += '.without.' + _.last(global.queryParamsRequiredAdded) ; - endpointPostman.aux.suffix = '.without.' +_.last(global.queryParamsRequiredAdded) ; + if (endpointPostman.aux.hasOwnProperty('suffix') && endpointPostman.aux.suffix.includes('wrong')) { + endpointPostman.name += '.with.' + endpointPostman.aux.suffix; + endpointPostman = require('./src/generator/queryParamsRequired.js')(endpointPostman); + endpointPostman.request.url.path[0] = _.replace(endpointPostman.request.url.path[0], '{{' +endpointPostman.aux.suffix.split(' ')[1]+ '}}', '{{' +endpointPostman.aux.suffix.split(' ')[1]+ '_wrong}}') + } else { + endpointPostman.name += '.without.' + _.last(global.queryParamsRequiredAdded); + endpointPostman.aux.suffix = '.without.' +_.last(global.queryParamsRequiredAdded); + } endpointsPostman.push(endpointPostman); } } while(endpointPostman) + + const endpointWithoutQueryParamsRequired = require('./src/generator/queryParamsNotRequired.js')(endpoint); + if (endpointWithoutQueryParamsRequired && endpoint) { + endpointsPostman.push(endpointWithoutQueryParamsRequired); + } + addBadRequestEndpoints(endpointsPostman, endpoint, 'requiredParams', '', true, false); addBadRequestEndpoints(endpointsPostman, endpoint, 'wrongParams', '.wrong', false, true); } else if ((endpoint.aux.status >= 200 && endpoint.aux.status < 300) || ((endpoint.aux.status === 401 || endpoint.aux.status === 403) && endpoint.aux.authorization)) { @@ -73,33 +86,80 @@ _.forEach(endpoints, function (endpoint, i) { } }) +const uniqueArray = []; +const hashTable = {}; + +endpointsPostman.forEach(obj => { + const key = JSON.stringify(obj); + if (!hashTable[key]) { + hashTable[key] = true; + uniqueArray.push(obj); + } +}); +endpointsPostman = uniqueArray; + //EXPORT-------------------------------- */ -let apiName = argv.api_name || configurationFile.api_name -configurationFile = configurationFile.environments -_.forEach(configurationFile, function (element) { +const apiName = argv.api_name || configurationFile.api_name; +let environments = configurationFile.environments; +_.forEach(environments, function (element) { const endpointsStage = _.cloneDeep(endpointsPostman) let exclude = {} - if ( element.read_only ){ + if ( element.read_only ) { exclude.write = true } + // Se añaden casos de éxito por cada scope indicado en el fichero de configuración + // También se añaden los nuevos tokens como variables en la cabecera Authorization + if (element.has_scopes) { + let actualLength = endpointsStage.length; + for (let i = 0; i < actualLength; i++) { + if (!endpointsStage[i].aux.authorization) { + endpointsStage[i].aux.authorization = 'user_token_with_scope1'; + endpointsStage[i].request.header.push({ + key: 'Authorization', + value: '{{user_token_with_scope1}}' + }); + } + let auth = endpointsStage[i].aux.authorization; + let name = _.endsWith(auth, '1') ? auth.substring(0, auth.length - 1) : auth; + if (endpointsStage[i].aux.status >= 200 && endpointsStage[i].aux.status < 400 && auth) { + // Añadir el Test Case con application_token + if (element.application_token) { + endpointsStage.push(createEndpointWithScope(endpointsStage[i], 'application_token')); + } + + // Añadir la cantidad indicada de Test Cases por cada scope_token + for (let j = 2; j <= element.number_of_scopes; j++) { + endpointsStage.push(createEndpointWithScope(endpointsStage[i], name + j)); + } + + if (typeof endpointsStage[i].aux.suffix !== 'undefined'){ + endpointsStage[i].aux.suffix += 'with.' + name + '1'; + } else endpointsStage[i].aux.suffix = 'with.' + name + '1'; + } + } + } if ( element.custom_authorizations_file ) { require('./src/parser/authorizationRequests.js')(endpointsStage,element.custom_authorizations_file) } else { + // Elimina la cabecera Authorization de las peticiones en Postman exclude.auth = true } - let endpointsPostmanWithFolders = require('./src/generator/folders.js')(endpointsStage, exclude) + let endpointsPostmanWithFolders = require('./src/generator/folders.js')(endpointsStage, exclude) + // Crea el listado de variables de entorno let environmentVariables = require('./src/generator/environmentVariablesNames.js')(endpointsPostmanWithFolders) - if (element.validate_schema === false){ - require('./src/generator/validateSchema.js')(endpointsPostmanWithFolders) + // Añadir letras a los TestCases con el mismo status code para diferenciarlos en el Runner + for (let i = element.custom_authorizations_file ? 1 : 0; i < endpointsPostmanWithFolders.length; i++) { + addLettersToName(endpointsPostmanWithFolders[i].item); } - if ( apiName ) { + + require('./src/generator/validateSchema.js')(endpointsPostmanWithFolders, element.validate_schema) + if ( typeof apiName === "string" && apiName !== undefined ) { element.postman_collection_name = _.replace(element.postman_collection_name, '%api_name%', apiName) element.postman_environment_name = _.replace(element.postman_environment_name, '%api_name%', apiName) } require('./src/generator/collection.js')(element.target_folder, element.postman_collection_name, endpointsPostmanWithFolders) require('./src/generator/environment.js')(element.target_folder, element.postman_environment_name, element.host, element.port, schemaHostBasePath,environmentVariables) }) - function addBadRequestEndpoints(endpointsPostman, endpointBase, memoryAlreadyAdded, suffix, withoutRequired, withWrongParam) { global[memoryAlreadyAdded] = []; do { @@ -113,3 +173,35 @@ function addBadRequestEndpoints(endpointsPostman, endpointBase, memoryAlreadyAdd } } while (global[memoryAlreadyAdded].length > initialCount) } + +function createEndpointWithScope(endpoint, name) { + let scopeEndpoint = _.cloneDeep(endpoint); + let authHeader = scopeEndpoint.request.header.find(obj => { return obj.key === 'Authorization' }); + + scopeEndpoint.aux.authorization = name; + if (typeof scopeEndpoint.aux.suffix !== 'undefined'){ + scopeEndpoint.aux.suffix += 'with.' + name; + } else scopeEndpoint.aux.suffix = 'with.' + name; + authHeader.value = `{{${name}}}`;//_.replace(authHeader.value, endpoint.aux.authorization, name); + + return scopeEndpoint; +} + +function addLettersToName(collection) { + const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); + + for (let i in collection) { + let orderedCollection = _.groupBy(collection[i].item, function(item) { return item.aux.status }); + for (let j in orderedCollection) { + let array = orderedCollection[j]; + if (array.length > 1) { + // Añade una letra al nombre de cada Test Case, justo despues del status code. Ej.: 200a OK + // Controla el exceso de Test Cases y añade dos letras en caso de ser necesario. Ej.: 200aa OK, 200ab OK + for (let k in array) { + array[k].name = _.replace(array[k].name, array[k].aux.status, + k < alphabet.length ? array[k].aux.status + alphabet[k] : array[k].aux.status + alphabet[Math.floor(k / alphabet.length) - 1] + alphabet[k % alphabet.length]); + } + } + } + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ea05fdf..b1d1e82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,28 +35,33 @@ "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==" }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==" + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" }, "ansi-regex": { - "version": "3.0.0", - "resolved": "http://npm.cloudappi.net:4873/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -75,26 +80,15 @@ "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=" }, - "array.prototype.map": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", - "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.4" - } - }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "brace-expansion": { "version": "1.1.11", @@ -119,218 +113,117 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" }, "camelcase": { - "version": "5.3.1", - "resolved": "http://npm.cloudappi.net:4873/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==" }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "dependencies": { "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } }, "chokidar": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", - "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.3.0" + "readdirp": "~3.6.0" } }, "cliui": { - "version": "4.1.0", - "resolved": "http://npm.cloudappi.net:4873/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "http://npm.cloudappi.net:4873/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - } + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "http://npm.cloudappi.net:4873/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "http://npm.cloudappi.net:4873/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "decamelize": { - "version": "1.2.0", - "resolved": "http://npm.cloudappi.net:4873/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==" }, "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, "emoji-regex": { - "version": "7.0.3", - "resolved": "http://npm.cloudappi.net:4873/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "http://npm.cloudappi.net:4873/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "^1.4.0" - } + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, - "es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" - }, - "es-get-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", - "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", - "requires": { - "es-abstract": "^1.17.4", - "has-symbols": "^1.0.1", - "is-arguments": "^1.0.4", - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-string": "^1.0.5", - "isarray": "^2.0.5" - }, - "dependencies": { - "isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - } - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "esprima": { "version": "4.0.1", "resolved": "http://npm.cloudappi.net:4873/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, - "execa": { - "version": "1.0.0", - "resolved": "http://npm.cloudappi.net:4873/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -340,20 +233,18 @@ } }, "find-up": { - "version": "3.0.0", - "resolved": "http://npm.cloudappi.net:4873/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "requires": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" } }, "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "requires": { - "is-buffer": "~2.0.3" - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" }, "fs.realpath": { "version": "1.0.0", @@ -361,33 +252,20 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "optional": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, "get-caller-file": { "version": "2.0.5", "resolved": "http://npm.cloudappi.net:4873/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, - "get-stream": { - "version": "4.1.0", - "resolved": "http://npm.cloudappi.net:4873/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -410,23 +288,10 @@ "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "he": { "version": "1.2.0", @@ -447,16 +312,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "invert-kv": { - "version": "2.0.0", - "resolved": "http://npm.cloudappi.net:4873/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" - }, - "is-arguments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" - }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -465,79 +320,38 @@ "binary-extensions": "^2.0.0" } }, - "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" - }, - "is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==" - }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "http://npm.cloudappi.net:4873/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "requires": { "is-extglob": "^2.1.1" } }, - "is-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", - "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==" - }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, - "is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-set": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", - "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==" - }, - "is-stream": { - "version": "1.1.0", - "resolved": "http://npm.cloudappi.net:4873/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==" + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "requires": { - "has-symbols": "^1.0.1" - } + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" }, "isarray": { "version": "0.0.1", @@ -549,20 +363,6 @@ "resolved": "http://npm.cloudappi.net:4873/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, - "iterate-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", - "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==" - }, - "iterate-value": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", - "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", - "requires": { - "es-get-iterator": "^1.0.2", - "iterate-iterator": "^1.0.1" - } - }, "js-yaml": { "version": "3.13.1", "resolved": "http://npm.cloudappi.net:4873/js-yaml/-/js-yaml-3.13.1.tgz", @@ -577,21 +377,12 @@ "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==" }, - "lcid": { - "version": "2.0.0", - "resolved": "http://npm.cloudappi.net:4873/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "requires": { - "invert-kv": "^2.0.0" - } - }, "locate-path": { - "version": "3.0.0", - "resolved": "http://npm.cloudappi.net:4873/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" } }, "lodash": { @@ -605,11 +396,12 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "requires": { - "chalk": "^2.4.2" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "lolex": { @@ -617,29 +409,6 @@ "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==" }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "http://npm.cloudappi.net:4873/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "requires": { - "p-defer": "^1.0.0" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "http://npm.cloudappi.net:4873/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "http://npm.cloudappi.net:4873/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -649,168 +418,79 @@ } }, "mocha": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", - "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "requires": { + "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.1", - "debug": "3.2.6", - "diff": "4.0.2", - "escape-string-regexp": "1.0.5", - "find-up": "4.1.0", - "glob": "7.1.6", + "chokidar": "3.5.2", + "debug": "4.3.2", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", - "ms": "2.1.2", - "object.assign": "4.1.0", - "promise.allsettled": "1.0.2", - "serialize-javascript": "3.0.0", - "strip-json-comments": "3.0.1", - "supports-color": "7.1.0", + "ms": "2.1.3", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.0.0", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { + "diff": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==" }, - "p-locate": { + "js-yaml": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "argparse": "^2.0.1" } }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - } + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } } } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "nice-try": { - "version": "1.0.5", - "resolved": "http://npm.cloudappi.net:4873/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==" }, "nise": { "version": "1.5.0", @@ -845,40 +525,6 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "http://npm.cloudappi.net:4873/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "http://npm.cloudappi.net:4873/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "object-inspect": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, "once": { "version": "1.4.0", "resolved": "http://npm.cloudappi.net:4873/once/-/once-1.4.0.tgz", @@ -887,67 +533,32 @@ "wrappy": "1" } }, - "os-locale": { - "version": "3.1.0", - "resolved": "http://npm.cloudappi.net:4873/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "http://npm.cloudappi.net:4873/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" - }, - "p-finally": { - "version": "1.0.0", - "resolved": "http://npm.cloudappi.net:4873/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "http://npm.cloudappi.net:4873/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" - }, "p-limit": { - "version": "2.2.0", - "resolved": "http://npm.cloudappi.net:4873/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "http://npm.cloudappi.net:4873/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "requires": { - "p-limit": "^2.0.0" + "p-limit": "^3.0.2" } }, - "p-try": { - "version": "2.2.0", - "resolved": "http://npm.cloudappi.net:4873/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, "path-exists": { - "version": "3.0.0", - "resolved": "http://npm.cloudappi.net:4873/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "path-key": { - "version": "2.0.1", - "resolved": "http://npm.cloudappi.net:4873/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, "path-to-regexp": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", @@ -957,37 +568,24 @@ } }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" }, - "promise.allsettled": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", - "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", - "requires": { - "array.prototype.map": "^1.0.1", - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", - "iterate-value": "^1.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "http://npm.cloudappi.net:4873/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "safe-buffer": "^5.1.0" } }, "readdirp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", - "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "requires": { - "picomatch": "^2.0.7" + "picomatch": "^2.2.1" } }, "require-directory": { @@ -995,49 +593,24 @@ "resolved": "http://npm.cloudappi.net:4873/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "http://npm.cloudappi.net:4873/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "samsam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==" }, - "semver": { - "version": "5.7.0", - "resolved": "http://npm.cloudappi.net:4873/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" - }, "serialize-javascript": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", - "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "http://npm.cloudappi.net:4873/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "http://npm.cloudappi.net:4873/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "requires": { - "shebang-regex": "^1.0.0" + "randombytes": "^2.1.0" } }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "http://npm.cloudappi.net:4873/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "http://npm.cloudappi.net:4873/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, "sinon": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.5.0.tgz", @@ -1052,11 +625,6 @@ "type-detect": "^4.0.5" }, "dependencies": { - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1078,79 +646,34 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "string-width": { - "version": "3.1.0", - "resolved": "http://npm.cloudappi.net:4873/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "http://npm.cloudappi.net:4873/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "http://npm.cloudappi.net:4873/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "http://npm.cloudappi.net:4873/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^5.0.1" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "http://npm.cloudappi.net:4873/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "requires": { "has-flag": "^4.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - } } }, "to-regex-range": { @@ -1167,82 +690,26 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, "which": { - "version": "1.3.1", - "resolved": "http://npm.cloudappi.net:4873/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "requires": { "isexe": "^2.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "http://npm.cloudappi.net:4873/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - } - } - }, "workerpool": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", - "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==" + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==" }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "http://npm.cloudappi.net:4873/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "http://npm.cloudappi.net:4873/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "http://npm.cloudappi.net:4873/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "http://npm.cloudappi.net:4873/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://npm.cloudappi.net:4873/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - } + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } }, "wrappy": { @@ -1251,98 +718,44 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, "yargs": { - "version": "13.2.2", - "resolved": "http://npm.cloudappi.net:4873/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.2.1.tgz", + "integrity": "sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q==", "requires": { - "cliui": "^4.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } }, "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==" }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - } + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } } } diff --git a/package.json b/package.json index 68779ec..67fae40 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "description": "swagger2postman", "main": "index.js", "scripts": { - "test": "node_modules/.bin/mocha" + "test": "mocha" }, "author": "Isidoro de la Vieja", "license": "ISC", "dependencies": { "js-yaml": "^3.13.1", "lodash": "^4.17.21", - "mocha": "^8.0.1", + "mocha": "^9.1.3", "sinon": "^4.5.0", - "yargs": "^13.2.2" + "yargs": "^17.2.1" } } diff --git a/src/generator/authorization.js b/src/generator/authorization.js index dbc922b..9ca5123 100644 --- a/src/generator/authorization.js +++ b/src/generator/authorization.js @@ -6,7 +6,7 @@ const _ = require('lodash'); module.exports = function() { - return function get(postmanRequest,status){ + return function get(postmanRequest, status){ if (!postmanRequest.aux.authorization){ return postmanRequest; } diff --git a/src/generator/body.js b/src/generator/body.js index 262cb58..8f1f0e8 100644 --- a/src/generator/body.js +++ b/src/generator/body.js @@ -5,12 +5,30 @@ const _ = require('lodash'); module.exports = function() { - + return function get(postmanRequest,withoutRequired,withWrongParam){ - postmanRequest = _.cloneDeep(postmanRequest); + postmanRequest = _.cloneDeep(postmanRequest); if (!postmanRequest.aux.body){ - return postmanRequest; + return postmanRequest; + } + + const urlWithoutParams = postmanRequest.request.url.path[0].split('?'); + if (postmanRequest.aux.suffix !== undefined && urlWithoutParams[1] !== undefined) { + + _.forEach(postmanRequest.aux.queryParams, function (value) { + if (value.required !== true) { + urlWithoutParams[1] = _.replace(urlWithoutParams[1], value.name + '={{' + value.name + '}}', ''); + urlWithoutParams[1] = urlWithoutParams[1].length <= 1 + ? _.replace(urlWithoutParams[1], urlWithoutParams[1], '') + : urlWithoutParams[1].replace(/&+/g, '&').replace(/^(\?&+)/, '?'); + } + urlWithoutParams[1] = urlWithoutParams[1].replace(/&$/, ''); + }) } + if (urlWithoutParams[1] === undefined) { + urlWithoutParams[1] = ''; + } + postmanRequest.request.url.path[0] = urlWithoutParams[0] + urlWithoutParams[1]; let parent; if (withoutRequired){ @@ -23,11 +41,55 @@ module.exports = function() { global.wrongParamsCatch = withWrongParam; global.requiredParamsCatch = withoutRequired; - postmanRequest.request.body = { - mode: "raw", - raw: JSON.stringify(require('../swagger2json/index.js')(postmanRequest.aux.body,'',parent), null, 4) - }; - return postmanRequest; + const body = require('../swagger2json/index.js')(postmanRequest.aux.body,'',parent); + let requestBody = { + mode: "raw", + raw: JSON.stringify(body, null, 4) + }; + const contentType = postmanRequest.request.header.find(h => h.key === 'Content-Type'); + const consumes = contentType ? contentType.value : 'application/json'; + + if (consumes.includes('x-www-form-urlencoded')) { + requestBody.mode = 'urlencoded'; + requestBody.urlencoded = []; + + Object.keys(body).forEach(key => { + let item = { + type: 'text' + }; + item.key = key; + + if (typeof body[key] === 'object') { + item.value = JSON.stringify(body[key]); + } else { + item.value = body[key]; + } + requestBody.urlencoded.push(item); + }); + delete requestBody.raw; + } else if (consumes.includes('multipart/form-data')) { + requestBody.mode = 'formdata'; + requestBody.formdata = []; + + Object.keys(body).forEach(key => { + let item = { + type: 'file' + }; + item.key = key; + + if (typeof body[key] === 'object') { + item.value = JSON.stringify(body[key]); + } else { + item.value = ''; + } + requestBody.formdata.push(item); + }); + delete requestBody.raw; + } + + postmanRequest.request.body = requestBody; + + return postmanRequest; }; }() \ No newline at end of file diff --git a/src/generator/collection.js b/src/generator/collection.js index c5bebd7..c517b2f 100644 --- a/src/generator/collection.js +++ b/src/generator/collection.js @@ -7,26 +7,30 @@ const argv = require('yargs').argv module.exports = function() { - return function post(target,title,endpointsPostman){ - if (! argv.target ){ - argv.target = process.cwd()+'/' - } + return function post(target, title, endpointsPostman) { + if (! argv.target ){ + argv.target = process.cwd()+'/' + } - const output = { - "info": { - "_postman_id": "8680b1d9-579c-43d2-8035-991b269c31e0", - "name": title, - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": endpointsPostman - } + const output = { + "info": { + "_postman_id": "8680b1d9-579c-43d2-8035-991b269c31e0", + "name": title, + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": endpointsPostman + } - try { - fs.writeFileSync(target+'/'+title+'.postman_collection.json', JSON.stringify(output)); - console.log(`Collection ${target+'/'+title+'.postman_collection.json'} was succesfully created`); - } catch(err) { - require('../utils/error.js')('Error writing the output: ' + target); - } + try { + if (!fs.existsSync(target)) { + fs.mkdirSync(target) + } + + fs.writeFileSync(target+'/'+title+'.postman_collection.json', JSON.stringify(output)); + console.log(`Collection ${target+'/'+title+'.postman_collection.json'} was succesfully created`); + } catch(err) { + require('../utils/error.js')('Error writing the output: ' + target); + } }; }() \ No newline at end of file diff --git a/src/generator/endpoints.js b/src/generator/endpoints.js index 5f32b90..534435a 100644 --- a/src/generator/endpoints.js +++ b/src/generator/endpoints.js @@ -6,34 +6,35 @@ const _ = require('lodash'); module.exports = function() { - return function get(endpoints){ + return function get(endpoints) { const items = []; - _.forEach(endpoints, function(endpoint){ + _.forEach(endpoints, function(endpoint) { let path = endpoint.path; let pathParameterSaved = false - _.forEach(endpoint.pathParameters,function(pathParameter){ - pathParameterSaved = pathParameter.name + _.forEach(endpoint.pathParameters, function(pathParameter) { + pathParameterSaved = pathParameter; path = _.replace(path, '{'+pathParameter.name+'}', '{{'+pathParameter.name+'}}') global.environmentVariables[endpoint.verb+endpoint.path+pathParameter.name] = require('../utils/exampleForField.js')(pathParameter,false) }); - _.forEach(endpoint.status,function(response){ - items.push({ - name: endpoint.path+'-'+response, - aux: { - status:response, - body:endpoint.body ? endpoint.body : false, - consumes: endpoint.consumes ? endpoint.consumes : false, - bodyResponse: endpoint.bodyResponse ? endpoint.bodyResponse : false, - authorization: endpoint.authorization ? endpoint.authorization : false, + _.forEach(endpoint.status,function(response) { + let item = { + name: endpoint.path + '-' + response, + aux: { + status:response, + body:endpoint.body ? endpoint.body : false, + consumes: endpoint.consumes ? endpoint.consumes : false, + bodyResponse: endpoint.bodyResponse ? endpoint.bodyResponse : false, + authorization: endpoint.authorization ? endpoint.authorization : false, summary: endpoint.summary ? endpoint.summary : false, queryParams: endpoint.queryParams ? endpoint.queryParams : false, - pathParameter: pathParameterSaved - }, - response: [], - request: { - method: endpoint.verb, - header: [], - body: { + pathParameter: pathParameterSaved.name, + pathParameterExample: pathParameterSaved.example || '' + }, + response: [], + request: { + method: endpoint.verb, + header: [], + body: { mode: "raw", raw: "" }, @@ -46,11 +47,64 @@ module.exports = function() { path ] } - } - }); + } + } + items.push(item); + + // Duplicidad de los Test Case POST de /recurso/get que tengan definido $filter, indicándolo en el nombre + if (item.aux.status >= 200 && item.aux.status < 400 && item.request.method === 'POST') { + let nameWithoutStatus = item.name.substring(0, item.name.length - 4); + if (nameWithoutStatus.substring(nameWithoutStatus.length - 4) === '/get' && item.aux.body.properties['$filter']) { + let clon = _.cloneDeep(item); + clon.aux.suffix = '$filter '; + clon.aux.queryParams = []; + items.push(clon); + } + } + + // Duplicar los endpoints para cada queryParameter + if (item.aux.status >= 200 && item.aux.status < 400 && item.aux.queryParams.length > 0) { + addQueryParamEndpoint(item, items); + } }); }); return items; }; + // Duplica los casos de éxito por cada queryParameter opcional distinto + function addQueryParamEndpoint(endpoint, items) { + let requiredParams = []; + let notRequiredParams; + + for (let i in endpoint.aux.queryParams) { + if (endpoint.aux.queryParams[i].required) { + requiredParams.push(endpoint.aux.queryParams[i]); + } + } + notRequiredParams = _.difference(endpoint.aux.queryParams, requiredParams); + for (let i in notRequiredParams) { + let item = _.cloneDeep(endpoint); + // Eliminar el $filter de los POST /recurso/get que se prueben con cada queryParameter + if (item.aux.status >= 200 && item.aux.status < 400 && item.request.method === 'POST') { + let nameWithoutStatus = item.name.substring(0, item.name.length - 4); + if (nameWithoutStatus.substring(nameWithoutStatus.length - 4) === '/get' && item.aux.body.properties['$filter']) { + item.aux.body = false; + } + } + item.aux.queryParams = _.concat(requiredParams, notRequiredParams[i]); + item.aux.suffix = `queryString ${notRequiredParams[i].name} `; + const itemWrong = _.cloneDeep(item); + const newitemWrong = addQueryParamEndpointWrong(itemWrong, notRequiredParams[i]); + items.push(item); + items.push(newitemWrong); + } + } + + function addQueryParamEndpointWrong(endpointWrong, notRequiredParam) { + endpointWrong.aux.status = 400; + endpointWrong.name = endpointWrong.name.substring(0, endpointWrong.name.length - 3) + endpointWrong.aux.status; + endpointWrong.aux.suffix = `queryString ${notRequiredParam.name} wrong`; + + return endpointWrong; + } }() \ No newline at end of file diff --git a/src/generator/environment.js b/src/generator/environment.js index b630196..883f683 100644 --- a/src/generator/environment.js +++ b/src/generator/environment.js @@ -42,6 +42,16 @@ module.exports = function() { "key": 'basePath', "enabled": true }) + const uniqueKeys = {}; + const arregloSinDuplicados = items.filter(obj => { + if (uniqueKeys[obj.key]) { + return false; + } else { + uniqueKeys[obj.key] = true; + return true; + } + }); + items = arregloSinDuplicados; items = _.orderBy(items, ['key'], ['asc']); @@ -54,7 +64,7 @@ module.exports = function() { try { fs.writeFileSync(target+'/'+title+'.postman_environment.json', JSON.stringify(output,null, 4)); - console.log(`Environment ${target+'/'+title+'.postman_environment.json'} was succesfully created`); + console.log(`Environment ${target+'/'+title+'.postman_environment.json'} was succesfully created`); } catch(err) { require('../utils/error.js')('Error writing the output: ' + target); } diff --git a/src/generator/environmentVariablesNames.js b/src/generator/environmentVariablesNames.js index e8c380c..2201869 100644 --- a/src/generator/environmentVariablesNames.js +++ b/src/generator/environmentVariablesNames.js @@ -5,78 +5,173 @@ const _ = require('lodash'); module.exports = function() { - + return function get(collection){ - const items = [] - const itemKeys = [] - for (let i in collection){ - for (let j in collection[i].item) { - if (collection[i].item[j].request) { - parseRequest(collection[i].item[j].aux.numerateItem,collection[i].item[j].request,items,itemKeys,'') - } else { - for (let k in collection[i].item[j].item){ - let id = collection[i].item[j].item[k].request.method + collection[i].item[j].item[k].request.url.path[0] - id = id.replace(/{{/g,'{').replace(/}}/g,'}').split('?')[0] - parseRequest(collection[i].item[j].item[k].aux.numerateItem,collection[i].item[j].item[k].request,items,itemKeys,id) - } - } - } - } - return items + const items = [] + const itemKeys = [] + for (let i in collection){ + for (let j in collection[i].item) { + if (collection[i].item[j].request) { + parseRequest(collection[i].item[j].aux.numerateItem,collection[i].item[j].request,items,itemKeys,'') + } else { + for (let k in collection[i].item[j].item) { + let id = collection[i].item[j].item[k].request.method + collection[i].item[j].item[k].request.url.path[0] + id = id.replace(/{{/g,'{').replace(/}}/g,'}').split('?')[0] + parseRequest(collection[i].item[j].item[k].aux.numerateItem, collection[i].item[j].item[k].request, items, itemKeys, id, collection[i].item[j].item[k].aux.queryParams) + + if (collection[i].item[j].item[k].event[0].script.exec, collection[i].item[j].item[k].aux.numerateItem, items) { + extractVariablesFromTest( + collection[i].item[j].item[k].aux, + collection[i].item[j].item[k].event[0].script.exec, + collection[i].item[j].item[k].aux.numerateItem, + items + ); + } + } + } + } + } + return items } - function parseRequest(numerateItem,request,items,itemKeys,id){ - request.url.raw = extractVariablesFromString(numerateItem,request.url.raw,items,itemKeys,id) - if (request.url.path && request.url.path[0]){ - request.url.path[0] = extractVariablesFromString(numerateItem,request.url.path[0],items,itemKeys,id) + function parseRequest(numerateItem, request, items, itemKeys, id, queryParams) { + request.url.raw = extractVariablesFromString(numerateItem,request.url.raw,items,itemKeys,id, undefined, queryParams) + if (request.url.path && request.url.path[0]){ + request.url.path[0] = extractVariablesFromString(numerateItem,request.url.path[0],items,itemKeys,id, undefined, queryParams); } if(request.header){ for (let i in request.header){ - request.header[i].key = extractVariablesFromString(numerateItem,request.header[i].key,items,itemKeys,id) - request.header[i].value = extractVariablesFromString(numerateItem,request.header[i].value,items,itemKeys,id) + request.header[i].key = extractVariablesFromString(numerateItem,request.header[i].key,items,itemKeys,id); + request.header[i].value = extractVariablesFromString(numerateItem, request.header[i].value, items, itemKeys, id, request.header[i].key === 'Authorization'); } } if (request.body && request.body.raw) { - request.body.raw = extractVariablesFromString(numerateItem,request.body.raw,items,itemKeys,id) + request.body.raw = extractVariablesFromString(numerateItem,request.body.raw,items,itemKeys,id); } else if (request.body && request.body.mode && request.body[request.body.mode]){ for (let i in request.body[request.body.mode]){ - request.body[request.body.mode][i].key = extractVariablesFromString(numerateItem,request.body[request.body.mode][i].key,items,itemKeys,id) - request.body[request.body.mode][i].value = extractVariablesFromString(numerateItem,request.body[request.body.mode][i].value,items,itemKeys,id) + request.body[request.body.mode][i].key = extractVariablesFromString(numerateItem,request.body[request.body.mode][i].key,items,itemKeys,id); + request.body[request.body.mode][i].value = extractVariablesFromString(numerateItem,request.body[request.body.mode][i].value,items,itemKeys,id); } - } + } if (request.auth && request.auth.type && request.auth[request.auth.type]){ for (let i in request.auth[request.auth.type]){ request.auth[request.auth.type][i].key = extractVariablesFromString(numerateItem,request.auth[request.auth.type][i].key,items,itemKeys,id) request.auth[request.auth.type][i].value = extractVariablesFromString(numerateItem,request.auth[request.auth.type][i].value,items,itemKeys,id) } } - } - - function extractVariablesFromString(numerateItem,string,items,itemKeys,id){ + } + + function extractVariablesFromString(numerateItem, string, items, itemKeys, id, isUserToken, queryParams = []){ const re = /\{\{(.*?)\}\}/g const newItems = string.match(re) for (let i in newItems){ - newItems[i] = newItems[i].substring(0,newItems[i].length - 2).substring(2) + newItems[i] = newItems[i].substring(0,newItems[i].length - 2).substring(2); if (_.includes(['host','port','basePath'], newItems[i])){ - continue + continue; + } + let key = isUserToken? newItems[i] : numerateItem + newItems[i]; + if (!_.includes(itemKeys, key)) { + let value = typeof global.environmentVariables[id+newItems[i]] !== 'undefined' ? global.environmentVariables[id+newItems[i]] : ''; + if (newItems[i].includes('_not_found')) { + value = require('../utils/exampleForField.js')( + { + name: newItems[i], + type: 'string', + example: value + }, + true + ); + } + if (queryParams.length > 0 && queryParams.filter(s => s.example !== 'application/pdf')) { + if (!!queryParams.find(s => s.name === newItems[i])) { + const queryItem = queryParams.find(s => s.name === newItems[i]); + const exampleExist = !!queryItem; + value = require('../utils/exampleForField.js')( + { + name: newItems[i], + type: queryItem.type, + example: validExample(queryItem), + }, + !exampleExist + ); + } + if (newItems[i].includes('_wrong')) { + const queryItem = queryParams.find(s => s.name === newItems[i].replace('_wrong', '')); + value = require('../utils/exampleForField.js')( + { + name: newItems[i], + type: queryItem.type, + example: validExample(queryItem), + }, + true + ); + } + } + // Cuando la variable is_inline del fichero de configuración no diga lo contrario, + // se guardarán las variables de entorno + if (!global.configurationFile.is_inline || isUserToken) { + items.push({ + "description": { + "content": "", + "type": "text/plain" + }, + "value": value, + "key": key, + "enabled": true + }); + itemKeys.push(key); + string = string.replace('{{'+newItems[i]+'}}', '{{'+key+'}}'); + } else { + // Se añade el valor del campo en el propio objeto de la petición + if (typeof value !== 'string') { + string = string.replace(`"{{${newItems[i]}}}"`, value); + } + string = string.replace(`{{${newItems[i]}}}`, value); + } + } else { + if (!global.configurationFile.is_inline || isUserToken) { + string = string.replace('{{'+newItems[i]+'}}', '{{'+key+'}}'); + } + } + } + return string; + } + function extractVariablesFromTest(aux, execCode, numerateItem, items){ + if (global.configurationFile.schema_is_inline === false) { + const key = numerateItem + 'schemaTest'; + for (let i in execCode){ + if (execCode[i] === 'var schema = pm.environment.get("schemaTest");'){ + execCode[i] = 'var schema = pm.environment.get("' + key + '");'; + } } - let key = numerateItem+newItems[i] - if (!_.includes(itemKeys, key)){ - let value = typeof global.environmentVariables[id+newItems[i]] !== 'undefined' ? global.environmentVariables[id+newItems[i]] : '' - items.push({ - "description": { - "content": "", - "type": "text/plain" - }, - "value": value, - "key": key, - "enabled": true - }) - itemKeys.push(key) - } - string = string.replace('{{'+newItems[i]+'}}','{{'+key+'}}') - } - return string + let schemaJSON = configurationFile.schema_pretty_print === true + ? JSON.stringify(aux.bodyResponse[aux.status], null, 4) + : JSON.stringify(aux.bodyResponse[aux.status]); + + items.push({ + "description": { + "content": "", + "type": "text/plain" + }, + "value": schemaJSON, + "key": key, + "enabled": true + }); + } } + function validExample(queryItem) { + let queryParamExample; + if (queryItem.type === 'array') { + if (queryItem.example !== undefined) { + queryParamExample = queryItem.example.toString(); + } else { + queryParamExample = ''; + } + } else { + queryParamExample = queryItem.example; + } + + return queryParamExample; + } }() \ No newline at end of file diff --git a/src/generator/folders.js b/src/generator/folders.js index 76effdb..0d501cf 100644 --- a/src/generator/folders.js +++ b/src/generator/folders.js @@ -8,11 +8,11 @@ module.exports = function() { return function get(endpointsPostman,exclude){ const result = [] - _.forEach(endpointsPostman,function(endpointPostman){ + _.forEach(endpointsPostman, function(endpointPostman){ if (!endpointPostman.authType && exclude.write && (endpointPostman.request.method !== 'GET' && endpointPostman.request.method !== 'OPTIONS')){ - return + return; } else if ((endpointPostman.authType || endpointPostman.aux.status == 401 || endpointPostman.aux.status == 403) && exclude.auth){ - return + return; } else if (endpointPostman.authType){ let folderRoot = _.find(result, ['name', 'authorizations']); if (!folderRoot) { @@ -52,7 +52,7 @@ module.exports = function() { let status = _.has(endpointPostman,'aux') && _.has(endpointPostman.aux, 'status') ? endpointPostman.aux.status : 'x'; let suffix = _.has(endpointPostman,'aux') && _.has(endpointPostman.aux,'suffix') ? ' ' + endpointPostman.aux.suffix : ' ' ; endpointPostman.name = status + ' ' + pathName + suffix; - deleteHeaderAuthorization(endpointPostman,exclude) + deleteHeaderAuthorization(endpointPostman, exclude); folder.item.push(endpointPostman); }); orderByMethod(result) @@ -60,20 +60,30 @@ module.exports = function() { return result; }; + // Numeración de los Test Cases function numerate(collection){ - let countRoot = 1 + let countRoot = 1; + if (collection.find(s => s.name === 'authorizations')) { + countRoot = 0; + } for (let i in collection){ let countItem = 1 - let numerateRoot = _.padStart(countRoot, 3, '0') + '.' + let numerateRoot = _.padStart(countRoot, 2, '0') + '.' collection[i].name = numerateRoot + collection[i].name for (let j in collection[i].item) { - let numerateItem = numerateRoot + _.padStart(countItem, 3, '0') + '.' + let numerateItem = numerateRoot + _.padStart(countItem, 2, '0') + '.' collection[i].item[j].name = numerateItem + collection[i].item[j].name if (!collection[i].item[j].aux){ collection[i].item[j].aux = {} } collection[i].item[j].aux.numerateItem = 'TC.' + numerateItem - for (let k in collection[i].item[j].item){ + // Ordenar la lista de Test Cases por status code ascendente + if (collection[i].item[j].item) { + collection[i].item[j].item = _.sortBy(collection[i].item[j].item, [function(item) { return item.aux.status; }]); + } + for (let k in collection[i].item[j].item) { + let statusResponse = shortName(collection[i].item[j].item[k].aux.status); + collection[i].item[j].item[k].name = _.replace(collection[i].item[j].item[k].name, collection[i].item[j].auxName, statusResponse).trim(); collection[i].item[j].item[k].name = 'TC.' + numerateItem + collection[i].item[j].item[k].name collection[i].item[j].item[k].aux.numerateItem = 'TC.' + numerateItem } @@ -114,4 +124,31 @@ module.exports = function() { endpointPostman.request.header = header } + function shortName (status) { + switch (status) { + case 200: + return 'Successfull'; + case 201: + return 'Created'; + case 202: + return 'Acepted'; + case 204: + return 'No Content'; + case 206: + return 'Partial Content'; + case 400: + return 'Error'; + case 401: + return 'Unauthorized'; + case 403: + return 'Forbidden'; + case 404: + return 'Not Found'; + case 409: + return 'Conflict'; + default: + return ' '; + } + } + }() \ No newline at end of file diff --git a/src/generator/queryParamsNotRequired.js b/src/generator/queryParamsNotRequired.js new file mode 100644 index 0000000..86b484b --- /dev/null +++ b/src/generator/queryParamsNotRequired.js @@ -0,0 +1,43 @@ +/** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ + +'use strict' + +const _ = require('lodash'); + +module.exports = function() { + + return function get(endpoint) { + if (endpoint.aux.queryParams.filter(s => s.required === true).length > 0) { + return false; + } + + let queryParams = ''; + let endpointPostmanRequest = _.cloneDeep(endpoint); + _.forEach(endpointPostmanRequest.aux.queryParams, function (endpointParam) { + + if (queryParams.length === 0){ + queryParams += '?'+endpointParam.name+'={{' + endpointParam.name + '}}' + } else { + queryParams += '&'+endpointParam.name+'={{' + endpointParam.name + '}}' + } + if (typeof endpointParam.default !== 'undefined') { + global.environmentVariables[endpoint.request.method + endpoint.request.url.path[0] + endpointParam.name] = endpointParam.default; + } else { + global.environmentVariables[endpoint.request.method + endpoint.request.url.path[0] + endpointParam.name] = require('../utils/exampleForField.js')(endpointParam,false); + } + }) ; + const urlWithoutParams = endpointPostmanRequest.request.url.path[0].split('?'); + endpointPostmanRequest.request.url.path[0] = urlWithoutParams[0] + queryParams; + + endpointPostmanRequest = require('./body.js')(endpointPostmanRequest) + if (endpointPostmanRequest.aux.hasOwnProperty('suffix') && endpointPostmanRequest.aux.suffix.includes('wrong')) { + endpointPostmanRequest.name += '.with.' + endpointPostmanRequest.aux.suffix; + endpointPostmanRequest = require('./queryParamsRequired.js')(endpointPostmanRequest); + endpointPostmanRequest.request.url.path[0] = _.replace(endpointPostmanRequest.request.url.path[0], '{{' +endpointPostmanRequest.aux.suffix.split(' ')[1]+ '}}', '{{' +endpointPostmanRequest.aux.suffix.split(' ')[1]+ '_wrong}}') + return endpointPostmanRequest; + } else { + return false; + } + }; + +}() \ No newline at end of file diff --git a/src/generator/queryParamsRequired.js b/src/generator/queryParamsRequired.js index 36d867c..34a4d50 100644 --- a/src/generator/queryParamsRequired.js +++ b/src/generator/queryParamsRequired.js @@ -6,30 +6,51 @@ const _ = require('lodash'); module.exports = function() { - return function get(postmanRequest,error){ - if (error && !postmanRequest.aux.queryParams){ - return false + return function get(postmanRequest, error) { + if (error && !postmanRequest.aux.queryParams) { + return false } let queryParams = ''; + postmanRequest = _.cloneDeep(postmanRequest); let errorAdded = false - _.forEach(postmanRequest.aux.queryParams,function(queryParam){ - if (error && !errorAdded && queryParam.required && !_.includes(global.queryParamsRequiredAdded, queryParam.name)){ - errorAdded = true - global.queryParamsRequiredAdded.push(queryParam.name) - return - } - if (queryParams.length === 0){ - queryParams += '?'+queryParam.name+'={{' + queryParam.name + '}}' - } else { - queryParams += '&'+queryParam.name+'={{' + queryParam.name + '}}' - } - global.environmentVariables[postmanRequest.request.method + postmanRequest.request.url.path[0] + queryParam.name] = require('../utils/exampleForField.js')(queryParam,false) + _.forEach(postmanRequest.aux.queryParams, function(queryParam) { + if (error && !errorAdded && queryParam.required && !_.includes(global.queryParamsRequiredAdded, queryParam.name)){ + errorAdded = true + global.queryParamsRequiredAdded.push(queryParam.name) + return + } + if (queryParams.length === 0){ + queryParams += '?'+queryParam.name+'={{' + queryParam.name + '}}' + } else { + queryParams += '&'+queryParam.name+'={{' + queryParam.name + '}}' + } + // El valor que tomará la variable de entorno será: Valor por defecto > valor del fichero de configuración + if (typeof queryParam.default !== 'undefined') { + global.environmentVariables[postmanRequest.request.method + postmanRequest.request.url.path[0] + queryParam.name] = queryParam.default; + } else { + global.environmentVariables[postmanRequest.request.method + postmanRequest.request.url.path[0] + queryParam.name] = require('../utils/exampleForField.js')(queryParam,false); + } }); - if (error && !errorAdded){ - return false + + if (error && !errorAdded) { + return false + } + + // Si es el main test quitar los queryparams opcionales + const urlWithoutParams = postmanRequest.request.url.path[0].split('?'); + if (postmanRequest.aux.suffix === undefined) { + _.forEach(postmanRequest.aux.queryParams, function (value) { + if (value.required !== true) { + queryParams = _.replace(queryParams, value.name + '={{' + value.name + '}}', ''); + queryParams = queryParams.length <= 1 + ? _.replace(queryParams, queryParams, '') + : queryParams.replace(/&+/g, '&').replace(/^(\?&+)/, '?'); + } + queryParams = queryParams.replace(/&$/, ''); + }) } - postmanRequest.request.url.path[0] += queryParams + postmanRequest.request.url.path[0] = urlWithoutParams[0] + queryParams; return postmanRequest; }; diff --git a/src/generator/testBody.js b/src/generator/testBody.js index 15581e3..c410037 100644 --- a/src/generator/testBody.js +++ b/src/generator/testBody.js @@ -3,24 +3,53 @@ 'use strict' const _ = require('lodash'); +const fs = require('fs'); module.exports = function() { - return function get(postmanRequest){ - if (!postmanRequest.aux.bodyResponse || !postmanRequest.aux.bodyResponse[postmanRequest.aux.status]){ - return postmanRequest; - } - postmanRequest.event[0].script.exec = _.concat(postmanRequest.event[0].script.exec,[ - "", - "var json = JSON.parse(responseBody);", - "", - "var schema = "+JSON.stringify(postmanRequest.aux.bodyResponse[postmanRequest.aux.status])+";", - "", - "pm.test('Schema is valid', function() {", - " pm.expect(tv4.validate(json, schema)).to.be.true;", - "});" - ]); - return postmanRequest; - }; + return function get(postmanRequest, configurationFile) { + + if ((!postmanRequest.aux.bodyResponse || !postmanRequest.aux.bodyResponse[postmanRequest.aux.status]) && postmanRequest.aux.status === 200) { + console.warn( + '\x1b[33m%s\x1b[0m', + `Test: ${postmanRequest.request.method} ${postmanRequest.name} (${postmanRequest.aux.suffix === undefined ? 'main test' : postmanRequest.aux.suffix.trim()}) without schema validation test because it has a different response than 'application/json'` + ); + return postmanRequest; + } + let schemaJSON; + + if (configurationFile.schema_is_inline === false) { + schemaJSON = 'pm.environment.get("schemaTest")'; + } else { + schemaJSON = configurationFile.schema_pretty_print === true + ? JSON.stringify(postmanRequest.aux.bodyResponse[postmanRequest.aux.status], null, 4) + : JSON.stringify(postmanRequest.aux.bodyResponse[postmanRequest.aux.status]); + } + postmanRequest.event[0].script.exec = _.concat(postmanRequest.event[0].script.exec,[ + "", + "var json = null;", + "", + "try {", + " json = pm.response.json();", + " // Guardar variables en environment", + " // pm.environment.set('nombreVariable', json.data.variable);", + "} catch (e) {", + " postMessage.test(\"Se esperaba una respuesta JSON\", function() {", + " pm.expect(json, \"responseBody no es un JSON\").not.to.be.null;", + " });", + "}", + "", + "var schema = "+schemaJSON+";", + "", + "var schemaIsValid = tv4.validate(json, schema);", + "if (!schemaIsValid) {", + " console.error(tv4.error);", + "}", + "pm.test('Schema is valid', function() {", + " pm.expect(schemaIsValid).to.be.true;", + "});" + ]); + return postmanRequest; +}; }() \ No newline at end of file diff --git a/src/generator/testStatus.js b/src/generator/testStatus.js index bdcdb7e..36168df 100644 --- a/src/generator/testStatus.js +++ b/src/generator/testStatus.js @@ -8,16 +8,16 @@ module.exports = function() { return function get(postmanRequest){ postmanRequest.event = [{ - listen: "test", - script: { - id: "63142ff5-28a4-40b2-8314-dcbeeaa89325", - type: "text/javascript", - exec: [ - "pm.test(\"Status code is "+postmanRequest.aux.status+"\", function () {", - " pm.response.to.have.status("+postmanRequest.aux.status+");", - "});" - ] - } + listen: "test", + script: { + id: "63142ff5-28a4-40b2-8314-dcbeeaa89325", + type: "text/javascript", + exec: [ + "pm.test(\"Status code is "+postmanRequest.aux.status+"\", function () {", + " pm.response.to.have.status("+postmanRequest.aux.status+");", + "});" + ] + } }]; return postmanRequest; }; diff --git a/src/generator/validateSchema.js b/src/generator/validateSchema.js index 51c278d..ae114b5 100644 --- a/src/generator/validateSchema.js +++ b/src/generator/validateSchema.js @@ -6,7 +6,7 @@ const _ = require('lodash'); module.exports = function() { - return function get(collection){ + return function get(collection, validate_schema){ const items = [] const itemKeys = [] for (let i in collection){ @@ -15,7 +15,15 @@ module.exports = function() { } else { for (let k in collection[i].item[j].item){//request - deleteValidateSchema(collection[i].item[j].item[k].event[0].script.exec) + + if (validate_schema === true) { + const params = new URLSearchParams('?' + collection[i].item[j].item[k].request.url.path[0].split('?')[1]); + if (params.get('$select') || params.get('$exclude')) { + deleteValidateSchema(collection[i].item[j].item[k].event[0].script.exec) + } + } else { + deleteValidateSchema(collection[i].item[j].item[k].event[0].script.exec) + } } } } @@ -26,8 +34,8 @@ module.exports = function() { function deleteValidateSchema(execCode){ let findEnd = false for (let i in execCode){ - if (execCode[i] === "pm.test('Schema is valid', function() {"){ - execCode[i] = "/*pm.test('Schema is valid', function() {" + if (execCode[i] === "var schemaIsValid = tv4.validate(json, schema);"){ + execCode[i] = "/*var schemaIsValid = tv4.validate(json, schema);" findEnd = true } if (findEnd && execCode[i] === "});"){ diff --git a/src/parser/authorization.js b/src/parser/authorization.js index fd2ae85..a82b383 100644 --- a/src/parser/authorization.js +++ b/src/parser/authorization.js @@ -5,12 +5,12 @@ const _ = require('lodash') module.exports = function() { - + return function get(verb,path){ - const endpoint = global.definition.paths[path][_.toLower(verb)] + const endpoint = global.definition.paths[path][_.toLower(verb)] let securityName = false if (endpoint.security && _.isArray(endpoint.security) && endpoint.security.length > 0){ - securityName = getTokenFromDefinition(endpoint.security[0]) + securityName = getTokenFromDefinition(endpoint.security[0]) + '1'; } if(global.definition.security && _.isArray(global.definition.security) && global.definition.security.length > 0 && securityName === false){ securityName = getTokenFromDefinition(global.definition.security[0]) diff --git a/src/parser/authorizationRequests.js b/src/parser/authorizationRequests.js index 08b1663..d45ae1e 100644 --- a/src/parser/authorizationRequests.js +++ b/src/parser/authorizationRequests.js @@ -15,13 +15,29 @@ module.exports = function() { try { definition = JSON.parse(fs.readFileSync(file, 'utf8')); } catch (e) { - require('../../utils/error.js')('error reading auth file ') + require('../utils/error.js')('error reading auth file '); } for (let i in definition.item){ definition.item[i].authType = true + // Comprobar que viene un status dentro del objeto aux para cada endpoint de autorización + if (definition.item[i].item) { + if (!definition.item[i].item[0].aux || !definition.item[i].item[0].aux.status) { + createStatus(definition.item[i].item); + } + } endpoints.unshift(definition.item[i]) } }; + function createStatus(collection) { + for (let i = 0; i < collection.length; i++) { + if (!collection[i].aux || !collection[i].aux.status) { + collection[i].aux = { + status: 200 + } + } + } + } + }() \ No newline at end of file diff --git a/src/parser/definition.js b/src/parser/definition.js index 696cb6f..ce39c0a 100644 --- a/src/parser/definition.js +++ b/src/parser/definition.js @@ -9,19 +9,22 @@ const path = require('path') module.exports = function() { - return function get(){ - - if (path.extname(argv.file) !== '.yaml' && path.extname(argv.file) !== '.yml'){ - require('../utils/error.js')('The yaml format not exist or not is correct: '+argv.file); - } - - let definition; - try { - definition = yaml.safeLoad(fs.readFileSync(argv.file, 'utf8')); - } catch (e) { - require('../utils/error.js')('The yaml format not exist or not is correct: '+argv.file); - } - return definition; + return function get() { + + try { + const contractFile = fs.existsSync(argv.file, 'utf8') + if (!contractFile) { + require('../utils/error.js')('The yaml file not found'); + } + if (path.extname(argv.file) !== '.yaml' && path.extname(argv.file) !== '.yml'){ + require('../utils/error.js')('The yaml format is not correct: '+argv.file); + } + + const definition = yaml.safeLoad(fs.readFileSync(argv.file, 'utf8')); + return definition; + } catch (e) { + require('../utils/error.js')('The yaml file does not exist or is not correct: ' + argv.file); + } }; }() \ No newline at end of file diff --git a/src/parser/openapi3/body.js b/src/parser/openapi3/body.js index 6a8eab7..b4e70df 100644 --- a/src/parser/openapi3/body.js +++ b/src/parser/openapi3/body.js @@ -6,127 +6,163 @@ const _ = require('lodash') module.exports = function() { - return function get(verb,path,bodyResponse){ + const MAX_DEPTH_LEVEL = 20; + + return function get(verb, path, bodyResponse) { if (!_.isObject(global.definition.paths)) { - require('../../utils/error.js')('paths is required') - } - - const endpoint = global.definition.paths[path][_.toLower(verb)] - if (!bodyResponse){ - let body = endpoint['requestBody'] - if (!body){ - return undefined - } - if (body['$ref']) { - let componentType = body['$ref'].split('/')[2] - const ref = _.replace(body['$ref'], '#/components/'+componentType+'/', '') - body = global.definition.components[componentType][ref] + require('../../utils/error.js')('paths is required') } - if (!body.content['application/json']) { - require('../../utils/error.js')('Endpoint: '+verb+' '+path+' is not application/json') + const endpoint = global.definition.paths[path][_.toLower(verb)] + if (!bodyResponse){ + let body = endpoint['requestBody']; + if (!body){ + return undefined; + } + if (body['$ref']) { + let componentType = body['$ref'].split('/')[2] + const ref = _.replace(body['$ref'], '#/components/'+componentType+'/', '') + body = global.definition.components[componentType][ref] + } + if (!body.content['application/json']) { + const contentsArray = Object.keys(body.content); + let schema = undefined; + let properContent = false; + let index = 0; + // Búsqueda de un content type soportado por la aplicación + while (!properContent && index < contentsArray.length) { + const withoutRefs = replaceRefs(body.content[contentsArray[index]].schema, 1); + switch(contentsArray[index]) { + case 'application/x-www-form-urlencoded': + schema = replaceAllOfs(withoutRefs); + properContent = true; + break; + case 'multipart/form-data': + schema = replaceAllOfs(body.content[contentsArray[index]].schema); + properContent = true; + break; + default: + properContent = false; + break; + } + index++; + } + + if (!properContent) console.warn('\x1b[33m%s\x1b[0m', `Warning: cannot create body due to unknown content type (Endpoint: ${verb} ${path})`); + return schema; + } + const withOutRefs = replaceRefs(body.content['application/json'].schema, 1); + return replaceAllOfs(withOutRefs); } - const withOutRefs = replaceRefs(body.content['application/json'].schema) - return replaceAllOfs(withOutRefs) - } - const bodyResponses = {} - _.forEach(endpoint['responses'],function(response,status){ - if (response && response.content && response.content['application/json'] && response.content['application/json'].schema){ - const withOutRefs = replaceRefs(response.content['application/json'].schema) - bodyResponses[status] = replaceAllOfs(withOutRefs) - } - }) - return bodyResponses + const bodyResponses = {} + _.forEach(endpoint['responses'], function(response, status) { + if (response && response.content && response.content['application/json'] && response.content['application/json'].schema) { + const withOutRefs = replaceRefs(response.content['application/json'].schema, 1) + bodyResponses[status] = replaceAllOfs(withOutRefs) + if (bodyResponses[status].hasOwnProperty('required')) { + const requiredWtihoutDuplicates = bodyResponses[status].required.filter((value, index, arr) => { + return arr.indexOf(value) === index; + }); + bodyResponses[status].required = requiredWtihoutDuplicates; + } + } + }) + return bodyResponses } - function replaceRefs(schema){ + function replaceRefs(schema, depthLevel) { let result = {} - for (let i in schema) { - if (i === '$ref'){ - let componentType = schema[i].split('/')[2] - const ref = _.replace(schema[i], '#/components/'+componentType+'/', '') - if (checkCircularReferences(ref,3,2) || checkCircularReferences(ref,3,3) || checkCircularReferences(ref,3,4)){ - return { type: 'string', - description: 'Circular REF solved swagger2postman' - } + if (depthLevel < MAX_DEPTH_LEVEL) { + for (const i in schema) { + if (i === '$ref') { + let componentType = schema[i].split('/')[2] + const ref = _.replace(schema[i], '#/components/'+componentType+'/', '') + if (checkCircularReferences(ref,3,2) || checkCircularReferences(ref,3,3) || checkCircularReferences(ref,3,4)){ + return { type: 'string', + description: 'Circular REF solved swagger2postman' } - let entity = global.definition.components[componentType][ref] - if (!entity){ - require('../../utils/error.js')('ref '+ref+' is not defined') - } - entity = replaceRefs(entity,global.definition) - result = _.merge(result, entity) - } else if ( _.isArray(schema[i]) && i !== 'required'){ - const arrayResult = [] - if (i === 'example'){ + } + let entity = global.definition.components[componentType][ref] + if (!entity) { + require('../../utils/error.js')('ref '+ref+' is not defined') + } + entity = replaceRefs(entity,global.definition, ++depthLevel) + result = _.merge(result, entity) + } else if ( _.isArray(schema[i]) && i !== 'required') { + const arrayResult = [] + if (i === 'example'){ continue - } - for (let k in schema[i]) { - arrayResult.push(replaceRefs(schema[i][k],global.definition)) - } - result[i] = arrayResult - } else if ( _.isObject(schema[i]) && i !== 'required'){ - result[i] = replaceRefs(schema[i],global.definition) - } else { - result[i] = schema[i] - } - } - return result + } + for (const k in schema[i]) { + // arrayResult.push(replaceRefs(schema[i][k], global.definition, ++depthLevel)) + arrayResult.push(schema[i][k]) + } + result[i] = arrayResult + } else if ( _.isObject(schema[i]) && i !== 'required') { + ++depthLevel; + result[i] = schema[i]; + // result[i] = replaceRefs(schema[i],global.definition); + } else { + result[i] = schema[i]; + } + } + } + return result } function replaceAllOfs(schema){ - let result = {} + let result = {} for (let i in schema) { - if (i === 'allOf' && _.isArray(schema[i])){ - let merged = {'required':[],'properties':{},'type':'object'} - for (let t in schema[i]) { + if (i === 'allOf' && _.isArray(schema[i])){ + let merged = {'required':[],'properties':{},'type':'object'} + for (let t in schema[i]) { - if (schema[i][t]['type'] === 'string') { - merged = schema[i][t] - } else { + if (schema[i][t]['type'] === 'string') { + merged = schema[i][t] + } else { - for (let k in schema[i][t]) { - if (k === 'type'){ - merged['type'] = schema[i][t][k] - } else if (k === 'required'){ - merged['required'] = _.concat(merged['required'],schema[i][t]['required']) - } else if (k === 'properties'){ - for (let z in schema[i][t]['properties']){ - merged['properties'][z] = replaceAllOfs(schema[i][t]['properties'][z]) - } - } else if (k === 'allOf'){ - let downSchema = replaceAllOfs(schema[k]) - if (downSchema['0']) { - downSchema = downSchema['0'] + for (let k in schema[i][t]) { + if (k === 'type'){ + merged['type'] = schema[i][t][k] + } else if (k === 'required'){ + merged['required'] = _.concat(merged['required'],schema[i][t]['required']) + } else if (k === 'properties'){ + for (let z in schema[i][t]['properties']){ + merged['properties'][z] = replaceAllOfs(schema[i][t]['properties'][z]) + } + } else if (k === 'allOf'){ + let downSchema = replaceAllOfs(schema[k]) + if (downSchema['0']) { + downSchema = downSchema['0'] + } + merged['required'] = _.concat(merged['required'],downSchema['required']) + merged['properties'] = _.merge(merged['properties'],downSchema['properties']) + continue + } else if (k === 'description') { + continue + } else { + require('../../utils/error.js')('the property '+k+' of allOf is not implemented') } - merged['required'] = _.concat(merged['required'],downSchema['required']) - merged['properties'] = _.merge(merged['properties'],downSchema['properties']) - continue - } else if (k === 'description'){ - continue - } else { - require('../../utils/error.js')('the property '+k+' of allOf is not implemented') } + } } - - } - result = _.merge(result, merged) - } else if ( _.isArray(schema[i]) && i !== 'required') { - const arrayResult = [] - for (let k in schema[i]) { - arrayResult.push(replaceAllOfs(schema[i][k])) - } - result[i] = arrayResult - } else if ( _.isObject(schema[i]) && i !== 'required') { + result = _.merge(result, merged) + } else if ( _.isArray(schema[i]) && i !== 'required') { + const arrayResult = [] + for (let k in schema[i]) { + arrayResult.push(replaceAllOfs(schema[i][k])) + } + result[i] = arrayResult + } else if ( _.isObject(schema[i]) && i !== 'required') { + // result.type = 'object'; result[i] = _.merge(result[i],replaceAllOfs(schema[i])) - } else { - result[i] = schema[i] - } - } - return result + } else { + result[i] = schema[i] + } + } + return result } - function checkCircularReferences(reference,depthLevel,patternNumber){ if (!global.circularTail){ diff --git a/src/parser/openapi3/queryParams.js b/src/parser/openapi3/queryParams.js index b4a9803..a40dba6 100644 --- a/src/parser/openapi3/queryParams.js +++ b/src/parser/openapi3/queryParams.js @@ -8,17 +8,64 @@ module.exports = function() { return function get(verb,path){ if (!_.isObject(global.definition.paths)) { - require('../../utils/error.js')('paths is required') - } - - const parameters = global.definition.paths[path][_.toLower(verb)]['parameters'] - const queryParams = _.filter(parameters, ['in', 'query']) - const result = [] - _.forEach(queryParams, function(queryParam) { - result.push( { name : queryParam.name , type : queryParam.schema.type, required : queryParam.required } ) - }) + require('../../utils/error.js')('paths is required') + } - return result + let parameters = global.definition.paths[path][_.toLower(verb)]['parameters']; + // parameters = replaceRefs(parameters); + let queryParams = _.filter(parameters, ['in', 'query']) + const result = [] + _.forEach(queryParams, function(queryParam) { + result.push({ + name: queryParam.name, + type: queryParam.schema.type, + required : queryParam.required, + example: getExamples(queryParam) + }); + }); + return result }; + function replaceRefs(schema){ + let result = {} + for (let i in schema) { + if (i === '$ref'){ + const ref = _.replace(schema[i], '#/components/parameters/', ''); + const schemaRef = _.replace(schema[i], '#/components/schemas/', ''); + let entity = global.definition.components.parameters[ref] || global.definition.components.schemas[schemaRef]; + if (!entity){ + require('../../utils/error.js')('ref '+ref+' is not defined') + } + entity = replaceRefs(entity,global.definition) + result = _.merge(result, entity) + } else if ( _.isArray(schema[i]) && i !== 'required'){ + const arrayResult = [] + if (i === 'example'){ + continue; + } + for (let k in schema[i]) { + arrayResult.push(replaceRefs(schema[i][k],global.definition)) + } + result[i] = arrayResult + } else if ( _.isObject(schema[i]) && i !== 'required'){ + result[i] = replaceRefs(schema[i],global.definition) + } else { + result[i] = schema[i]; + } + } + return result; + } + + function getExamples(queryParam) { + if (queryParam.schema.type === 'array') { + return queryParam.example + } else { + if (queryParam.hasOwnProperty('examples')) { + const value = queryParam.examples[Object.keys(queryParam.examples)[0]]; + return value[Object.keys(value)[0]]; + } + return queryParam.example; + } + } + }() \ No newline at end of file diff --git a/src/parser/openapi3/refs.js b/src/parser/openapi3/refs.js index 6654c80..8f4cbc3 100644 --- a/src/parser/openapi3/refs.js +++ b/src/parser/openapi3/refs.js @@ -3,19 +3,17 @@ 'use strict' function eachRecursive(obj) { - for (var k in obj) { + for (var k in obj) { if (typeof obj[k] == "object" && obj[k] !== null) { eachRecursive(obj[k]); } else { - if(k == '$ref') { + if (k == '$ref') { let property = obj[k] property = property.replace('#/', '') let propertiesArray = property.split('/') let refObject = findObject(global.definition, propertiesArray) - // Clear ref property delete obj[k] - // Assign properties refOcject Object.assign(obj, refObject) } diff --git a/src/parser/openapi3/schemaHostBasePath.js b/src/parser/openapi3/schemaHostBasePath.js index d861cb2..fe1fe6e 100644 --- a/src/parser/openapi3/schemaHostBasePath.js +++ b/src/parser/openapi3/schemaHostBasePath.js @@ -7,21 +7,21 @@ const _ = require('lodash'); module.exports = function() { return function get(){ - if (!global.definition.servers || !_.isArray(global.definition.servers) || !global.definition.servers[0] || !global.definition.servers[0].url || !_.isString(global.definition.servers[0].url)){ - require('../../utils/error.js')('servers is required') - } - const all = global.definition.servers[0].url - const allArray = all.split( '/' ) - const protocol = allArray[0] - if (protocol !== 'http:' && protocol !== 'https:' && protocol !== '{scheme}:') { - require('../../utils/error.js')('servers.url should be http or https') + if (!global.definition.servers || !_.isArray(global.definition.servers) || !global.definition.servers[0] || !global.definition.servers[0].url || !_.isString(global.definition.servers[0].url)) { + require('../../utils/error.js')('servers is required') } - const domain = allArray[2] - const host = protocol + '//' + domain - return { - host: host, - basePath: all.replace(host, '') - }; + const all = global.definition.servers[0].url + const allArray = all.split( '/' ) + const protocol = allArray[0] + if (protocol !== 'http:' && protocol !== 'https:' && protocol !== '{scheme}:') { + require('../../utils/error.js')('servers.url should be http or https') + } + const domain = allArray[2] + const host = protocol + '//' + domain + return { + host: host, + basePath: all.replace(host, '') + }; }; }() \ No newline at end of file diff --git a/src/parser/status.js b/src/parser/status.js index 145b527..b3dcf86 100644 --- a/src/parser/status.js +++ b/src/parser/status.js @@ -13,13 +13,13 @@ module.exports = function() { const responses = global.definition.paths[path][_.toLower(verb)]['responses'] const keys = _.keys(responses) - for (let i in keys) { - keys[i] = _.toInteger(keys[i]) - if (keys[i] < 200) { - keys[i] = 500 + for (const index in keys) { + keys[index] = _.toInteger(keys[index]) + if (keys[index] < 200) { + keys[index] = 500 + } } - } - return keys + return keys } }() \ No newline at end of file diff --git a/src/parser/swagger2/body.js b/src/parser/swagger2/body.js index f886f8d..90a7d55 100644 --- a/src/parser/swagger2/body.js +++ b/src/parser/swagger2/body.js @@ -6,45 +6,55 @@ const _ = require('lodash'); module.exports = function() { - return function get(verb,path,bodyResponse){ + return function get(verb, path, bodyResponse) { if (!_.isObject(global.definition.paths)) { - require('../../utils/error.js')('paths is required'); - } - - const endpoint = global.definition.paths[path][_.toLower(verb)]; - if (!bodyResponse){ - const body = _.find(endpoint['parameters'], ['in', 'body']); - if (!body){ - return undefined; - } - const withOutRefs = replaceRefs(body.schema); - return replaceAllOfs(withOutRefs); - } - const bodyResponses = {}; - _.forEach(endpoint['responses'],function(response,status){ - if (response.schema){ - const withOutRefs = replaceRefs(response.schema); - bodyResponses[status] = replaceAllOfs(withOutRefs); - } - }); - return bodyResponses; + require('../../utils/error.js')('paths is required'); + } + + const endpoint = global.definition.paths[path][_.toLower(verb)]; + if (!bodyResponse){ + let bodyParameter = replaceRefs(endpoint['parameters']); + const body = _.find(bodyParameter, ['in', 'body']); + if (!body) { + return undefined; + } + const withOutRefs = replaceRefs(body.schema); + return replaceAllOfs(withOutRefs); + } + const bodyResponses = {}; + _.forEach(endpoint['responses'], function(response, status) { + if (response.schema){ + const withOutRefs = replaceRefs(response.schema); + bodyResponses[status] = replaceAllOfs(withOutRefs); + if (bodyResponses[status].hasOwnProperty('required')) { + const requiredWtihoutDuplicates = bodyResponses[status].required.filter((value, index, arr) => { + return arr.indexOf(value) === index; + }); + bodyResponses[status].required = requiredWtihoutDuplicates; + } + } + }); + return bodyResponses; }; function replaceRefs(schema){ let result = {}; for (let i in schema) { if (i === '$ref'){ - const ref = _.replace(schema[i], '#/definitions/', ''); - if (checkCircularReferences(ref,3,2) || checkCircularReferences(ref,3,3) || checkCircularReferences(ref,3,4)){ + const ref = _.replace(schema[i], schema[i].substring(0, schema[i].lastIndexOf('/') + 1), ''); + if (checkCircularReferences(ref, 3, 2) || checkCircularReferences(ref, 3, 3) || checkCircularReferences(ref, 3, 4)){ return { type: 'string', description: 'Circular REF solved swagger2postman' } } let entity = global.definition.definitions[ref]; if (!entity){ - require('../../utils/error.js')('ref '+ref+' is not defined'); + entity = global.definition.parameters[ref]; + if (!entity) { + require('../../utils/error.js')('ref ' + ref + ' is not defined'); + } } - entity = replaceRefs(entity,global.definition); + entity = replaceRefs(entity, global.definition); result = _.merge(result, entity); } else if ( _.isArray(schema[i]) && i !== 'required'){ const arrayResult = []; @@ -118,8 +128,7 @@ module.exports = function() { return result; } - - function checkCircularReferences(reference,depthLevel,patternNumber){ + function checkCircularReferences(reference, depthLevel, patternNumber){ if (!global.circularTail){ global.circularTail = [] } diff --git a/src/parser/swagger2/consumes.js b/src/parser/swagger2/consumes.js index 5f1f2c0..14b3c87 100644 --- a/src/parser/swagger2/consumes.js +++ b/src/parser/swagger2/consumes.js @@ -6,7 +6,7 @@ const _ = require('lodash'); module.exports = function() { - return function get(verb,path){ + return function get(verb, path){ if (!_.isObject(global.definition.paths)) { require('../../utils/error.js')('paths is required'); } diff --git a/src/parser/swagger2/pathParameters.js b/src/parser/swagger2/pathParameters.js index c074e4c..e5c5407 100644 --- a/src/parser/swagger2/pathParameters.js +++ b/src/parser/swagger2/pathParameters.js @@ -5,20 +5,50 @@ const _ = require('lodash'); module.exports = function() { - - return function get(verb,path){ - if (!_.isObject(global.definition.paths)) { - require('../../utils/error.js')('paths is required') - } - const parameters = global.definition.paths[path][_.toLower(verb)]['parameters'] - const parametersPath = _.filter(parameters, ['in', 'path']) - const result = [] - _.forEach(parametersPath, function(parameterPath) { - result.push( { name : parameterPath.name , type: parameterPath.type, example: parameterPath.example} ) - }) + return function get(verb,path){ + if (!_.isObject(global.definition.paths)) { + require('../../utils/error.js')('paths is required'); + } + + let parameters = global.definition.paths[path][_.toLower(verb)]['parameters']; + parameters = replaceRefs(parameters); + const parametersPath = _.filter(parameters, ['in', 'path']); + const result = [] + _.forEach(parametersPath, function(parameterPath) { + result.push( { name : parameterPath.name , type: parameterPath.type, example: parameterPath.example} ); + }) - return result - } + return result + } + + function replaceRefs(schema){ + let result = {}; + for (let i in schema) { + if (i === '$ref'){ + const ref = _.replace(schema[i], '#/parameters/', ''); + let entity = global.definition.parameters[ref]; + if (!entity){ + continue; + } + entity = replaceRefs(entity, global.definition); + result = _.merge(result, entity); + } else if (_.isArray(schema[i]) && i !== 'required'){ + const arrayResult = []; + if (i === 'example'){ + continue; + } + for (let k in schema[i]) { + arrayResult.push(replaceRefs(schema[i][k],global.definition)); + } + result[i] = arrayResult; + } else if (_.isObject(schema[i]) && i !== 'required'){ + result[i] = replaceRefs(schema[i],global.definition); + } else { + result[i] = schema[i]; + } + } + return result; + } -}() \ No newline at end of file +}(); \ No newline at end of file diff --git a/src/parser/swagger2/queryParams.js b/src/parser/swagger2/queryParams.js index 4ac2bb8..4620d90 100644 --- a/src/parser/swagger2/queryParams.js +++ b/src/parser/swagger2/queryParams.js @@ -11,14 +11,64 @@ module.exports = function() { require('../../utils/error.js')('paths is required') } - const parameters = global.definition.paths[path][_.toLower(verb)]['parameters'] + let parameters = global.definition.paths[path][_.toLower(verb)]['parameters']; + // parameters = replaceRefs(parameters); const queryParams = _.filter(parameters, ['in', 'query']) const result = [] _.forEach(queryParams, function(queryParam) { - result.push( { name : queryParam.name , type : queryParam.type, required : queryParam.required } ) + result.push({ + name : queryParam.name, + type : queryParam.type, + required : queryParam.required, + example: getExamples(queryParam) + }); }) return result }; + function replaceRefs(schema){ + let result = {}; + for (let i in schema) { + if (i === '$ref'){ + const ref = _.replace(schema[i], '#/parameters/', ''); + let entity = global.definition.parameters[ref]; + if (!entity){ + continue; + } + entity = replaceRefs(entity, global.definition); + result = _.merge(result, entity); + } else if (_.isArray(schema[i]) && i !== 'required'){ + const arrayResult = []; + if (i === 'example'){ + continue; + } + for (let k in schema[i]) { + arrayResult.push(replaceRefs(schema[i][k],global.definition)); + } + result[i] = arrayResult; + } else if (_.isObject(schema[i]) && i !== 'required'){ + result[i] = replaceRefs(schema[i],global.definition); + } else { + result[i] = schema[i]; + } + } + return result; + } + + function getExamples(queryParam) { + if (queryParam.type === 'array') { + return queryParam.example; + } else { + if (queryParam.hasOwnProperty('examples')) { + const value = queryParam.examples[Object.keys(queryParam.examples)[0]]; + return value[Object.keys(value)[0]]; + } else if (queryParam.hasOwnProperty('default')) { + return queryParam.default; + } else { + return queryParam.example !== undefined ? queryParam.example : ''; + } + } + } + }() \ No newline at end of file diff --git a/src/swagger2json/index.js b/src/swagger2json/index.js index 566731e..906622a 100644 --- a/src/swagger2json/index.js +++ b/src/swagger2json/index.js @@ -6,10 +6,16 @@ const _ = require('lodash'); module.exports = function() { - return function get(swagger,name,parent){ - - if (!swagger.type && swagger.properties){ - swagger.type = 'object'; + return function get(swagger, name, parent){ + + if (!swagger.type){ + if (swagger.properties) { + swagger.type = 'object'; + } else if (swagger.oneOf) { + swagger = swagger.oneOf[0]; + } else if (swagger.anyOf) { + swagger = swagger.anyOf[0]; + } } let wrongParam = false; diff --git a/src/swagger2json/object.js b/src/swagger2json/object.js index b0be394..0a344c7 100644 --- a/src/swagger2json/object.js +++ b/src/swagger2json/object.js @@ -5,10 +5,10 @@ const _ = require('lodash'); module.exports = function() { - + return function get(swagger,parent){ if (!swagger.properties){ - require('../utils/error.js')('There is a object without properties'); + require('../utils/error.js')(`There is an object without properties: ${swagger}`); } let notInclude = false; if (parent && global.requiredParamsCatch && _.has(swagger, 'required')){ diff --git a/src/utils/exampleForField.js b/src/utils/exampleForField.js index cd74dc0..b4146b5 100644 --- a/src/utils/exampleForField.js +++ b/src/utils/exampleForField.js @@ -2,38 +2,77 @@ 'use strict' +const _ = require('lodash'); + module.exports = function() { return function getExample(swagger,isWrong){ if (swagger.type === 'string') { - return getExampleForString(swagger.example,isWrong) + if (swagger.format === 'date') return getExampleForDate(swagger.example, isWrong); + if (swagger.format === 'date-time') return getExampleForDateTime(swagger.example, isWrong); + return getExampleForString(swagger.example, isWrong, swagger.maxLength); } else if(swagger.type === 'boolean'){ return getExampleForBoolean(swagger.example,isWrong) } else if(swagger.type === 'object'){ return getExampleForObject() } else if(swagger.type === 'array'){ - return getExampleForArray() + return getExampleForArray(swagger.example, isWrong) } - return getExampleForNumber(swagger.example,isWrong) + return getExampleForNumber(swagger.example, isWrong, swagger.maximum, swagger.minimum); } function getExampleForObject() { return getValueFromConfigurationFile('wrong','object','badobject') } - function getExampleForArray() { - return getValueFromConfigurationFile('wrong','array','badarray') + function getExampleForArray(example, isWrong) { + if (isWrong) { + return getValueFromConfigurationFile('wrong','array','badarray'); + } + return typeof example !== 'undefined' ? example : getValueFromConfigurationFile('wrong','array','badarray'); } - function getExampleForString(example,isWrong) { + function getExampleForString(example, isWrong, maxLength) { if (isWrong) { + // Crear caso de error con maxLength + 1 + if (example && maxLength) { + return _.padEnd(example, maxLength + 1, 'z'); + } return getValueFromConfigurationFile('wrong','string','badstring') } return typeof example !== 'undefined' ? example : getValueFromConfigurationFile('successful','string','anystring') } - function getExampleForNumber(example,isWrong) { + function getExampleForDate(example, isWrong) { + if (isWrong) { + // El mes con valor 50 para casos de error + if (example) { + let date = example.split('-'); + date[1] = '50'; + return date.join('-'); + } + return getValueFromConfigurationFile('wrong','date','baddate'); + } + return typeof example !== 'undefined' ? example : getValueFromConfigurationFile('successful','date','anydate'); + } + + function getExampleForDateTime(example, isWrong) { + if (isWrong) { + // El mes con valor 50 para casos de error + if (example) { + let month = example.substring(4, 7); + return example.replace(month, '-50'); + } + return getValueFromConfigurationFile('wrong','date_time','baddate'); + } + return typeof example !== 'undefined' ? example : getValueFromConfigurationFile('successful','date_time','anydate'); + } + + function getExampleForNumber(example, isWrong, max, min) { if (isWrong) { + // Devuelve max + 1 o min - 1 para casos de error, si existen + if (typeof max !== 'undefined') return max + 1; + if (typeof min !== 'undefined') return min - 1; return getValueFromConfigurationFile('wrong','number','badnumber') } return typeof example !== 'undefined' ? example : getValueFromConfigurationFile('successful','number',1) diff --git a/test/generator-authorization.js b/test/generator-authorization.js index dea8cfd..7aed250 100644 --- a/test/generator-authorization.js +++ b/test/generator-authorization.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -15,4 +13,4 @@ describe('generator-authorization', () => { assert.deepStrictEqual(endpoint, endpointResult); }); -}); +}); \ No newline at end of file diff --git a/test/generator-body.js b/test/generator-body.js index f0b5ab5..fbb835b 100644 --- a/test/generator-body.js +++ b/test/generator-body.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -108,4 +106,4 @@ describe('generator-body', () => { assert.deepStrictEqual(definition, definitionResult) }); -}); +}); \ No newline at end of file diff --git a/test/generator-contentType.js b/test/generator-contentType.js index 141d496..409e066 100644 --- a/test/generator-contentType.js +++ b/test/generator-contentType.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -15,4 +13,4 @@ describe('generator-contentType', () => { assert.deepStrictEqual(definition, definitionResult); }); -}); +}); \ No newline at end of file diff --git a/test/generator-endpoints.js b/test/generator-endpoints.js index 945ac1e..bd8ac4d 100644 --- a/test/generator-endpoints.js +++ b/test/generator-endpoints.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -15,4 +13,4 @@ describe('generator-endpoints', () => { assert.deepStrictEqual(definition, definitionResult); }); -}); +}); \ No newline at end of file diff --git a/test/generator-folders.js b/test/generator-folders.js index 1087467..034bde1 100644 --- a/test/generator-folders.js +++ b/test/generator-folders.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -15,4 +13,4 @@ describe('generator-folders', () => { assert.deepStrictEqual(output, outputResult) }); -}); +}); \ No newline at end of file diff --git a/test/generator-testBody.js b/test/generator-testBody.js index 7ca4741..a6a0246 100644 --- a/test/generator-testBody.js +++ b/test/generator-testBody.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -11,8 +9,8 @@ describe('generator-testBody', () => { const definitionInitial = require('../seeds/generatorTestBodyInitial.json'); const definitionResult = require('../seeds/generatorTestBodyResult.json'); - const definition = require('../src/generator/testBody.js')(definitionInitial); + const definition = require('../src/generator/testBody.js')(definitionInitial, {schema_pretty_print: false}); assert.deepStrictEqual(definition, definitionResult); }); -}); +}); \ No newline at end of file diff --git a/test/generator-testStatus.js b/test/generator-testStatus.js index cc4d22b..d1380c3 100644 --- a/test/generator-testStatus.js +++ b/test/generator-testStatus.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -15,4 +13,4 @@ describe('generator-testStatus', () => { assert.deepStrictEqual(definition, definitionResult); }); -}); +}); \ No newline at end of file diff --git a/test/parser-authorization.js b/test/parser-authorization.js index fc20c49..1e3ca96 100644 --- a/test/parser-authorization.js +++ b/test/parser-authorization.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -41,4 +39,4 @@ describe('parser-authorization', () => { assert.deepStrictEqual(authorization, 'OAuth2') }) -}) +}) \ No newline at end of file diff --git a/test/parser-body.js b/test/parser-body.js index ae688c7..e957752 100644 --- a/test/parser-body.js +++ b/test/parser-body.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert') @@ -96,4 +94,4 @@ describe('parser-body', () => { assert.deepStrictEqual(body, {"type":"object","properties":{"red":{"type":"string","maxLength":50}}}) }) -}) +}) \ No newline at end of file diff --git a/test/parser-consumes.js b/test/parser-consumes.js index ddf597f..77cf001 100644 --- a/test/parser-consumes.js +++ b/test/parser-consumes.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert') @@ -30,4 +28,4 @@ describe('parser-consumes', () => { assert.equal(consumes, 'application/json'); }) -}) +}) \ No newline at end of file diff --git a/test/parser-endpoints.js b/test/parser-endpoints.js index cbc0ad6..3e51c2a 100644 --- a/test/parser-endpoints.js +++ b/test/parser-endpoints.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -51,4 +49,4 @@ describe('parser-endpoints', () => { }) -}) +}) \ No newline at end of file diff --git a/test/parser-pathParameters.js b/test/parser-pathParameters.js index c839c7c..6415713 100644 --- a/test/parser-pathParameters.js +++ b/test/parser-pathParameters.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -22,4 +20,4 @@ describe('parser-pathParameters', () => { assert.deepStrictEqual(status, [ { name: 'petId', type: 'string', example: 'asdf' } ]) }) -}) +}) \ No newline at end of file diff --git a/test/parser-queryParams.js b/test/parser-queryParams.js index 2613762..3806fb4 100644 --- a/test/parser-queryParams.js +++ b/test/parser-queryParams.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -56,4 +54,4 @@ describe('parser-queryParams', () => { assert.deepStrictEqual(queryParams, []) }) -}) +}) \ No newline at end of file diff --git a/test/parser-schemaHostBasePath.js b/test/parser-schemaHostBasePath.js index cf71e31..55d283c 100644 --- a/test/parser-schemaHostBasePath.js +++ b/test/parser-schemaHostBasePath.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -21,4 +19,4 @@ describe('parser-schemaHostBasePath', () => { const schemaHostBasePath = require('../src/parser/openapi3/schemaHostBasePath.js')(); assert.deepStrictEqual(schemaHostBasePath, { host: 'http://petstore.swagger.io', basePath: '/v1' }); }) -}); +}); \ No newline at end of file diff --git a/test/parser-status.js b/test/parser-status.js index a94287f..b0d83c4 100644 --- a/test/parser-status.js +++ b/test/parser-status.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -22,4 +20,4 @@ describe('parser-status', () => { assert.deepStrictEqual(status, [ 201, 500 ]) }) -}); +}); \ No newline at end of file diff --git a/test/parser-summary.js b/test/parser-summary.js index 2fb7901..f8b1211 100644 --- a/test/parser-summary.js +++ b/test/parser-summary.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert'); @@ -22,4 +20,4 @@ describe('parser-summary', () => { assert.equal(summary, "Create pet") }) -}) +}) \ No newline at end of file diff --git a/test/parser-version.js b/test/parser-version.js index 0880aa8..abcafd1 100644 --- a/test/parser-version.js +++ b/test/parser-version.js @@ -1,5 +1,3 @@ --n -e /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ - /** Part of APIAddicts. See LICENSE fileor full copyright and licensing details. Supported by Madrid Digital and CloudAPPi **/ const assert = require('assert') @@ -22,4 +20,4 @@ describe('parser-version', () => { assert.equal(version, 'openapi3') }); -}); +}); \ No newline at end of file