Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ const componentSchemas = {
SchemaOne: {
type: 'string',
},
SchemaTwo: {
SchemaTwoRequest: {
type: 'object',
properties: {
name: {
type: 'string',
readOnly: true,
writeOnly: true,
},
otherThing: {
type: 'string',
},
},
},
Expand All @@ -29,12 +32,15 @@ const componentSchemas = {
},
},
},
SchemaFour: {
SchemaTwoResponse: {
type: 'object',
properties: {
name: {
type: 'string',
writeOnly: true,
readOnly: true,
},
otherThing: {
type: 'string',
},
},
},
Expand Down Expand Up @@ -132,12 +138,12 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaTwoRequest',
},
},
'application/vnd.atlas.2024-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaTwoRequest',
},
},
},
Expand All @@ -151,7 +157,12 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaFour',
$ref: '#/components/schemas/SchemaTwoResponse',
},
},
'application/vnd.atlas.2024-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwoResponse',
},
},
},
Expand Down Expand Up @@ -244,7 +255,7 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaTwoRequest',
},
},
},
Expand All @@ -258,12 +269,12 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaTwoResponse',
},
},
'application/vnd.atlas.2024-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaTwoResponse',
},
},
},
Expand Down Expand Up @@ -382,56 +393,56 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceTwo', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceTwo', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceThree', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'Could not validate that the Create request body schema matches the response schema of the Get method. The Get method does not have a schema. http://go/ipa/106',
'Could not validate that the Create request body schema matches the response schema of the Get method. The Get method does not have a schema. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceFour', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceCircular', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceCircular', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
Expand Down Expand Up @@ -481,14 +492,14 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/animalResource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
message:
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa/106',
'The request body schema properties must match the response body schema properties of the Get method. http://go/ipa-spectral#IPA-106',
path: ['paths', '/animalResource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
Expand All @@ -511,14 +522,6 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
'xgen-IPA-106-create-method-request-body-is-get-method-response': 'reason',
},
},
'application/vnd.atlas.2024-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaOne',
},
'x-xgen-IPA-exception': {
'xgen-IPA-106-create-method-request-body-is-get-method-response': 'reason',
},
},
},
},
},
Expand All @@ -530,7 +533,7 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaThree',
},
},
},
Expand All @@ -544,15 +547,15 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaTwoRequest',
},
'x-xgen-IPA-exception': {
'xgen-IPA-106-create-method-request-body-is-get-method-response': 'reason',
},
},
'application/vnd.atlas.2024-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaTwo',
$ref: '#/components/schemas/SchemaTwoRequest',
},
'x-xgen-IPA-exception': {
'xgen-IPA-106-create-method-request-body-is-get-method-response': 'reason',
Expand All @@ -569,43 +572,7 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaThree',
},
},
},
},
},
},
},
'/resourceThree': {
post: {
requestBody: {
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaOne',
},
'x-xgen-IPA-exception': {
'xgen-IPA-106-create-method-request-body-is-get-method-response': 'reason',
},
},
'application/vnd.atlas.2024-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaThree',
},
},
},
},
},
},
'/resourceThree/{id}': {
get: {
responses: {
200: {
content: {
'application/vnd.atlas.2023-01-01+json': {
schema: {
$ref: '#/components/schemas/SchemaThree',
$ref: '#/components/schemas/SchemaTwoResponse',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,31 +154,36 @@ testRule('xgen-IPA-106-create-method-request-body-is-request-suffixed-object', [
errors: [
{
code: 'xgen-IPA-106-create-method-request-body-is-request-suffixed-object',
message: 'The response body schema must reference a schema with a Request suffix. http://go/ipa/106',
message:
'The response body schema must reference a schema with a Request suffix. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-request-suffixed-object',
message: 'The response body schema must reference a schema with a Request suffix. http://go/ipa/106',
message:
'The response body schema must reference a schema with a Request suffix. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-request-suffixed-object',
message: 'The response body schema must reference a schema with a Request suffix. http://go/ipa/106',
message:
'The response body schema must reference a schema with a Request suffix. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceTwo', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-request-suffixed-object',
message: 'The response body schema must reference a schema with a Request suffix. http://go/ipa/106',
message:
'The response body schema must reference a schema with a Request suffix. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceTwo', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-body-is-request-suffixed-object',
message: 'The response body schema is defined inline and must reference a predefined schema. http://go/ipa/106',
message:
'The response body schema is defined inline and must reference a predefined schema. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceThree', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ testRule('xgen-IPA-106-create-method-request-has-no-readonly-fields', [
{
code: 'xgen-IPA-106-create-method-request-has-no-readonly-fields',
message:
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at: id. http://go/ipa/106',
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at: id. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-request-has-no-readonly-fields',
message:
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at one of the inline schemas. http://go/ipa/106',
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at one of the inline schemas. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
Expand Down Expand Up @@ -192,7 +192,7 @@ testRule('xgen-IPA-106-create-method-request-has-no-readonly-fields', [
{
code: 'xgen-IPA-106-create-method-request-has-no-readonly-fields',
message:
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at: user.userId. http://go/ipa/106',
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at: user.userId. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
Expand Down Expand Up @@ -225,7 +225,7 @@ testRule('xgen-IPA-106-create-method-request-has-no-readonly-fields', [
{
code: 'xgen-IPA-106-create-method-request-has-no-readonly-fields',
message:
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at: items.items.itemId. http://go/ipa/106',
'The Create method request object must not include input fields (readOnly properties). Found readOnly property at: items.items.itemId. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
severity: DiagnosticSeverity.Warning,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ testRule('xgen-IPA-106-create-method-response-code-is-201', [
{
code: 'xgen-IPA-106-create-method-response-code-is-201',
message:
'The Create method must return a 201 Created response. This method either lacks a 201 Created response or defines a different 2xx status code. http://go/ipa/106',
'The Create method must return a 201 Created response. This method either lacks a 201 Created response or defines a different 2xx status code. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceOne', 'post'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-response-code-is-201',
message:
'The Create method must return a 201 Created response. This method either lacks a 201 Created response or defines a different 2xx status code. http://go/ipa/106',
'The Create method must return a 201 Created response. This method either lacks a 201 Created response or defines a different 2xx status code. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceTwo', 'post'],
severity: DiagnosticSeverity.Warning,
},
{
code: 'xgen-IPA-106-create-method-response-code-is-201',
message:
'The Create method must return a 201 Created response. This method either lacks a 201 Created response or defines a different 2xx status code. http://go/ipa/106',
'The Create method must return a 201 Created response. This method either lacks a 201 Created response or defines a different 2xx status code. http://go/ipa-spectral#IPA-106',
path: ['paths', '/resourceThree', 'post'],
severity: DiagnosticSeverity.Warning,
},
Expand Down
Loading
Loading