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?
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
add a comment |
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
add a comment |
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
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
json testing automated-tests schema postman
asked Mar 7 at 17:29
VidhiVidhi
10819
10819
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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;
);
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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;
);
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
add a comment |
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;
);
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
add a comment |
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;
);
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;
);
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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