How to store and reuse schema within different collections in Postman?2019 Community Moderator ElectionXML Schema (XSD) validation tool?How to manage multiple JSON schema files?How can I export the schema of a database in PostgreSQL?How to validate against a definition within a schema?How to store postman collections in source controlCan the Postman collection be exported in json format with tests not wrapped in events?Postman Collection is passing in Postman Runner but not It's failing in Command prompt and in Jenkins jobHow to keep Postman collections and tests in sync with swagger/open api specs and git in a CI flowHow to create JSON file from postman collection(s)How to set JSON Schema as a global variable in Postman?

Do native speakers use "ultima" and "proxima" frequently in spoken English?

Knife as defense against stray dogs

What is the significance behind "40 days" that often appears in the Bible?

Variable completely messes up echoed string

Is there a creature that is resistant or immune to non-magical damage other than bludgeoning, slashing, and piercing?

Turning a hard to access nut?

What does Jesus mean regarding "Raca," and "you fool?" - is he contrasting them?

Recruiter wants very extensive technical details about all of my previous work

In Aliens, how many people were on LV-426 before the Marines arrived​?

What is the English word for a graduation award?

Maths symbols and unicode-math input inside siunitx commands

Should I be concerned about student access to a test bank?

I seem to dance, I am not a dancer. Who am I?

How to generate binary array whose elements with values 1 are randomly drawn

Using Past-Perfect interchangeably with the Past Continuous

Could Sinn Fein swing any Brexit vote in Parliament?

Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?

Print last inputted byte

What is the term when voters “dishonestly” choose something that they do not want to choose?

Worshiping one God at a time?

Brake pads destroying wheels

What does "Four-F." mean?

How are passwords stolen from companies if they only store hashes?

Comment Box for Substitution Method of Integrals



How to store and reuse schema within different collections in Postman?



2019 Community Moderator ElectionXML Schema (XSD) validation tool?How to manage multiple JSON schema files?How can I export the schema of a database in PostgreSQL?How to validate against a definition within a schema?How to store postman collections in source controlCan the Postman collection be exported in json format with tests not wrapped in events?Postman Collection is passing in Postman Runner but not It's failing in Command prompt and in Jenkins jobHow to keep Postman collections and tests in sync with swagger/open api specs and git in a CI flowHow to create JSON file from postman collection(s)How to set JSON Schema as a global variable in Postman?










0















I'm working on Postman testing and I want to validate the schema against the response. The schema is applicable to a lot of different collections in the work-space and so I would want to store it in a separate file and reuse.



Is there a way to reference that file within the collection and extract that file along with when the collection is exported.



  • For example: example.postman_collection.json would also contain the referenced file.

  • From my research so far, I have found that files can be imported at the time the collection is run which is not what I'm looking for. I don't want any external dependencies.

If not, what would be the other way to handle this in Postman and reuse the schema within different collections?



Thanks!










share|improve this question


























    0















    I'm working on Postman testing and I want to validate the schema against the response. The schema is applicable to a lot of different collections in the work-space and so I would want to store it in a separate file and reuse.



    Is there a way to reference that file within the collection and extract that file along with when the collection is exported.



    • For example: example.postman_collection.json would also contain the referenced file.

    • From my research so far, I have found that files can be imported at the time the collection is run which is not what I'm looking for. I don't want any external dependencies.

    If not, what would be the other way to handle this in Postman and reuse the schema within different collections?



    Thanks!










    share|improve this question
























      0












      0








      0








      I'm working on Postman testing and I want to validate the schema against the response. The schema is applicable to a lot of different collections in the work-space and so I would want to store it in a separate file and reuse.



      Is there a way to reference that file within the collection and extract that file along with when the collection is exported.



      • For example: example.postman_collection.json would also contain the referenced file.

      • From my research so far, I have found that files can be imported at the time the collection is run which is not what I'm looking for. I don't want any external dependencies.

      If not, what would be the other way to handle this in Postman and reuse the schema within different collections?



      Thanks!










      share|improve this question














      I'm working on Postman testing and I want to validate the schema against the response. The schema is applicable to a lot of different collections in the work-space and so I would want to store it in a separate file and reuse.



      Is there a way to reference that file within the collection and extract that file along with when the collection is exported.



      • For example: example.postman_collection.json would also contain the referenced file.

      • From my research so far, I have found that files can be imported at the time the collection is run which is not what I'm looking for. I don't want any external dependencies.

      If not, what would be the other way to handle this in Postman and reuse the schema within different collections?



      Thanks!







      json testing automated-tests schema postman






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 17:29









      VidhiVidhi

      10819




      10819






















          1 Answer
          1






          active

          oldest

          votes


















          0














          is there any reason you want to store it as a file?
          You can store schema as a global or environmental variable and they can be easily accessed.



          //Var for schema
          const customerSchema =
          "required": ["id"],
          "properties":
          "id":
          "type": "integer",
          "minimum": 100,
          "maximum": 1000
          ,
          "name":
          "type": "string",
          "minLength": 1,
          "maxLength": 25


          ;

          //Store it as environmental variable (or global).
          pm.environment.set("customerSchema", customerSchema);

          //Get it from environmental variable (or global).
          var expectedSchema = pm.environment.get("customerSchema");

          //validate
          pm.test('Customer schema is matching expected result', function()
          pm.expect(tv4.validate(responseBody, expectedSchema)).to.be.true;
          );





          share|improve this answer























          • Currently I'm storing the schema as a variable the same way you described. But I want it's scope to extend to other collections as well. It's a schema shared by several collections.

            – Vidhi
            Mar 8 at 12:53











          • You can use the same environment for multiple collections. I understand that's not the answer you're looking for. Just saying.

            – Tamara Tamarara
            Mar 8 at 16:01












          • Absolutely agree! That's the last resort I'm planning on using, since it would introduce ordering dependency among the collections. The one containing schema would always need to be run first. But, thanks for looking into it!

            – Vidhi
            Mar 8 at 16:59










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049716%2fhow-to-store-and-reuse-schema-within-different-collections-in-postman%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          is there any reason you want to store it as a file?
          You can store schema as a global or environmental variable and they can be easily accessed.



          //Var for schema
          const customerSchema =
          "required": ["id"],
          "properties":
          "id":
          "type": "integer",
          "minimum": 100,
          "maximum": 1000
          ,
          "name":
          "type": "string",
          "minLength": 1,
          "maxLength": 25


          ;

          //Store it as environmental variable (or global).
          pm.environment.set("customerSchema", customerSchema);

          //Get it from environmental variable (or global).
          var expectedSchema = pm.environment.get("customerSchema");

          //validate
          pm.test('Customer schema is matching expected result', function()
          pm.expect(tv4.validate(responseBody, expectedSchema)).to.be.true;
          );





          share|improve this answer























          • Currently I'm storing the schema as a variable the same way you described. But I want it's scope to extend to other collections as well. It's a schema shared by several collections.

            – Vidhi
            Mar 8 at 12:53











          • You can use the same environment for multiple collections. I understand that's not the answer you're looking for. Just saying.

            – Tamara Tamarara
            Mar 8 at 16:01












          • Absolutely agree! That's the last resort I'm planning on using, since it would introduce ordering dependency among the collections. The one containing schema would always need to be run first. But, thanks for looking into it!

            – Vidhi
            Mar 8 at 16:59















          0














          is there any reason you want to store it as a file?
          You can store schema as a global or environmental variable and they can be easily accessed.



          //Var for schema
          const customerSchema =
          "required": ["id"],
          "properties":
          "id":
          "type": "integer",
          "minimum": 100,
          "maximum": 1000
          ,
          "name":
          "type": "string",
          "minLength": 1,
          "maxLength": 25


          ;

          //Store it as environmental variable (or global).
          pm.environment.set("customerSchema", customerSchema);

          //Get it from environmental variable (or global).
          var expectedSchema = pm.environment.get("customerSchema");

          //validate
          pm.test('Customer schema is matching expected result', function()
          pm.expect(tv4.validate(responseBody, expectedSchema)).to.be.true;
          );





          share|improve this answer























          • Currently I'm storing the schema as a variable the same way you described. But I want it's scope to extend to other collections as well. It's a schema shared by several collections.

            – Vidhi
            Mar 8 at 12:53











          • You can use the same environment for multiple collections. I understand that's not the answer you're looking for. Just saying.

            – Tamara Tamarara
            Mar 8 at 16:01












          • Absolutely agree! That's the last resort I'm planning on using, since it would introduce ordering dependency among the collections. The one containing schema would always need to be run first. But, thanks for looking into it!

            – Vidhi
            Mar 8 at 16:59













          0












          0








          0







          is there any reason you want to store it as a file?
          You can store schema as a global or environmental variable and they can be easily accessed.



          //Var for schema
          const customerSchema =
          "required": ["id"],
          "properties":
          "id":
          "type": "integer",
          "minimum": 100,
          "maximum": 1000
          ,
          "name":
          "type": "string",
          "minLength": 1,
          "maxLength": 25


          ;

          //Store it as environmental variable (or global).
          pm.environment.set("customerSchema", customerSchema);

          //Get it from environmental variable (or global).
          var expectedSchema = pm.environment.get("customerSchema");

          //validate
          pm.test('Customer schema is matching expected result', function()
          pm.expect(tv4.validate(responseBody, expectedSchema)).to.be.true;
          );





          share|improve this answer













          is there any reason you want to store it as a file?
          You can store schema as a global or environmental variable and they can be easily accessed.



          //Var for schema
          const customerSchema =
          "required": ["id"],
          "properties":
          "id":
          "type": "integer",
          "minimum": 100,
          "maximum": 1000
          ,
          "name":
          "type": "string",
          "minLength": 1,
          "maxLength": 25


          ;

          //Store it as environmental variable (or global).
          pm.environment.set("customerSchema", customerSchema);

          //Get it from environmental variable (or global).
          var expectedSchema = pm.environment.get("customerSchema");

          //validate
          pm.test('Customer schema is matching expected result', function()
          pm.expect(tv4.validate(responseBody, expectedSchema)).to.be.true;
          );






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 7 at 21:55









          Tamara TamararaTamara Tamarara

          13




          13












          • Currently I'm storing the schema as a variable the same way you described. But I want it's scope to extend to other collections as well. It's a schema shared by several collections.

            – Vidhi
            Mar 8 at 12:53











          • You can use the same environment for multiple collections. I understand that's not the answer you're looking for. Just saying.

            – Tamara Tamarara
            Mar 8 at 16:01












          • Absolutely agree! That's the last resort I'm planning on using, since it would introduce ordering dependency among the collections. The one containing schema would always need to be run first. But, thanks for looking into it!

            – Vidhi
            Mar 8 at 16:59

















          • Currently I'm storing the schema as a variable the same way you described. But I want it's scope to extend to other collections as well. It's a schema shared by several collections.

            – Vidhi
            Mar 8 at 12:53











          • You can use the same environment for multiple collections. I understand that's not the answer you're looking for. Just saying.

            – Tamara Tamarara
            Mar 8 at 16:01












          • Absolutely agree! That's the last resort I'm planning on using, since it would introduce ordering dependency among the collections. The one containing schema would always need to be run first. But, thanks for looking into it!

            – Vidhi
            Mar 8 at 16:59
















          Currently I'm storing the schema as a variable the same way you described. But I want it's scope to extend to other collections as well. It's a schema shared by several collections.

          – Vidhi
          Mar 8 at 12:53





          Currently I'm storing the schema as a variable the same way you described. But I want it's scope to extend to other collections as well. It's a schema shared by several collections.

          – Vidhi
          Mar 8 at 12:53













          You can use the same environment for multiple collections. I understand that's not the answer you're looking for. Just saying.

          – Tamara Tamarara
          Mar 8 at 16:01






          You can use the same environment for multiple collections. I understand that's not the answer you're looking for. Just saying.

          – Tamara Tamarara
          Mar 8 at 16:01














          Absolutely agree! That's the last resort I'm planning on using, since it would introduce ordering dependency among the collections. The one containing schema would always need to be run first. But, thanks for looking into it!

          – Vidhi
          Mar 8 at 16:59





          Absolutely agree! That's the last resort I'm planning on using, since it would introduce ordering dependency among the collections. The one containing schema would always need to be run first. But, thanks for looking into it!

          – Vidhi
          Mar 8 at 16:59



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049716%2fhow-to-store-and-reuse-schema-within-different-collections-in-postman%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme