You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pay attention to Orders schema, which looks something like:
"order": {
"type": "object",
"title": "Order",
"description": "The order details.",
"allOf": [
{
"$ref": "#/components/schemas/activity_timestamps"
},
{
"properties": {
"id": {
"type": "string",
"description": "The ID of the order.",
"readOnly": true
},
...
The problem I'm facing is that the Order model doesn't contain any property at all, though it is (probably correctly) a subclass of activity_timestamps.
Generated code:
publicclassOrder:Activity_timestamps,IParsable{/// <summary>/// Creates a new instance of the appropriate class based on discriminator value/// </summary>/// <returns>A <see cref="Order"/></returns>/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>publicstaticnewOrderCreateFromDiscriminatorValue(IParseNodeparseNode){_=parseNode??thrownewArgumentNullException(nameof(parseNode));returnnewOrder();}/// <summary>/// The deserialization information for the current model/// </summary>/// <returns>A IDictionary<string, Action<IParseNode>></returns>publicoverrideIDictionary<string,Action<IParseNode>>GetFieldDeserializers(){returnnewDictionary<string,Action<IParseNode>>(base.GetFieldDeserializers()){};}/// <summary>/// Serializes information the current object/// </summary>/// <param name="writer">Serialization writer to use to serialize this model</param>publicoverridevoidSerialize(ISerializationWriterwriter){_=writer??thrownewArgumentNullException(nameof(writer));base.Serialize(writer);}}
The text was updated successfully, but these errors were encountered:
Looks like the solution from #4346 works - moving properties out of 'allOf' array to sibling position to allOf fixes it. Code then seems properly generated.
Like
Thanks for reaching out and for the detailed analysis. Since this looks extremely similar to the other issue, and since a fix is already in progress, I'm going to go ahead and close it as duplicate. Please follow the other issue to get updates.
Here is the PayPal Orders v2 API which I'm trying to generate code for.
Pay attention to Orders schema, which looks something like:
The problem I'm facing is that the Order model doesn't contain any property at all, though it is (probably correctly) a subclass of activity_timestamps.
Generated code:
The text was updated successfully, but these errors were encountered: