Skip to content

Commit

Permalink
Fix tests and more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-dou committed Jan 31, 2025
1 parent 4d4c644 commit 1f7a968
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@
"type": {
"$ref": "#/20"
},
"flags": 1
"flags": 1,
"description": "The list of object ids to be included in the relationship."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@

## MicrosoftGraphRelationship
### Properties
* **relationships**: string[] (Required)
* **relationships**: string[] (Required): The list of object ids to be included in the relationship.
* **relationshipSemantics**: 'append' | 'replace' | string: Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'

## MicrosoftGraphRequestSignatureVerification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@
"type": {
"$ref": "#/15"
},
"flags": 1
"flags": 1,
"description": "The list of object ids to be included in the relationship."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@

## MicrosoftGraphRelationship
### Properties
* **relationships**: string[] (Required)
* **relationships**: string[] (Required): The list of object ids to be included in the relationship.
* **relationshipSemantics**: 'append' | 'replace' | string: Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'

## MicrosoftGraphRequestSignatureVerification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"description": "The list of object ids to be included in the relationship."
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"description": "The list of object ids to be included in the relationship."
}
},
"required": [
Expand Down
1 change: 1 addition & 0 deletions src/swagger-generation/src/swaggerWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const writeSwagger = (definitionMap: DefinitionMap, config: Config): Swag
items: {
"type": "string"
},
description: "The list of object ids to be included in the relationship."
},
},
required: ["relationships"]
Expand Down
64 changes: 40 additions & 24 deletions src/swagger-generation/tests/swaggerWriter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@ describe('generate swagger with primitive types', () => {
Product.application_json
],
"definitions": {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down Expand Up @@ -253,17 +255,19 @@ describe('generate swagger with primitive types', () => {
Product.application_json
],
"definitions": {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down Expand Up @@ -469,17 +473,19 @@ describe('generate swagger with primitive types', () => {
Product.application_json
],
"definitions": {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down Expand Up @@ -594,17 +600,19 @@ describe('generate swagger with primitive types', () => {
Product.application_json
],
"definitions": {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down Expand Up @@ -732,17 +740,19 @@ describe('generate swagger with primitive types', () => {
Product.application_json
],
"definitions": {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down Expand Up @@ -863,17 +873,19 @@ describe('complexTypes', () => {
Product.application_json
],
definitions: {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down Expand Up @@ -1016,17 +1028,19 @@ describe('complex types with collections', () => {
Product.application_json
],
definitions: {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down Expand Up @@ -1189,17 +1203,19 @@ describe('enums', () => {
Product.application_json
],
definitions: {
"msgraph.relationshipSemantics": {
"microsoft.graph.relationshipSemantics": {
type: "string",
enum: ["append", "replace"]
},
"msgraph.relationship": {
"microsoft.graph.relationship": {
type: "object",
properties: {
relationshipSemantics: {
$ref: "#/definitions/msgraph.relationshipSemantics"
$ref: "#/definitions/microsoft.graph.relationshipSemantics",
description: "Specifies the semantics used by the Microsoft Graph Bicep extension to process the relationships. The 'append' semantics means that the relationship items in the template are added to the existing list. The 'replace' semantics means that the relationship items in the template will replace all existing items in the Entra resource. The default value (if not set) is 'append'"
},
relationships: {
description: "The list of object ids to be included in the relationship.",
type: "array",
items: {
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"description": "The list of object ids to be included in the relationship."
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"type": "array",
"items": {
"type": "string"
}
},
"description": "The list of object ids to be included in the relationship."
}
},
"required": [
Expand Down

0 comments on commit 1f7a968

Please sign in to comment.