Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Nested parameters or structures must be specified when not referencing an existing structure.
GodofThunder
#1 Posted : Monday, June 25, 2018 3:07:40 PM(UTC)


Hello,

I'm seeing this error in several places in the generated files. Here's an example...

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://www.xomega.net/omodel" xmlns:xfk="http://www.xomega.net/framework"
xmlns:wcf="http://www.xomega.net/wcf"
xmlns:rest="http://www.xomega.net/rest"
xmlns:ui="http://www.xomega.net/ui"
xmlns:asp="clr-namespace:System.Web.UI.WebControls;assembly=System.Web"
xmlns:sql="http://www.xomega.net/sql"
xmlns:clr="http://www.xomega.net/clr"
xmlns:edm="http://www.xomega.net/edm">
<fieldsets>
<fieldset name="asp net user logins">
<field name="login provider" type="string128" required="true">
<config>
<sql:column name="LoginProvider"/>
</config>
</field>
<field name="provider key" type="string128" required="true">
<config>
<sql:column name="ProviderKey"/>
</config>
</field>
<field name="user id" type="asp net users" required="true">
<config>
<sql:column name="UserId"/>
<sql:foreign-key delete="cascade"/>
</config>
</field>
</fieldset>
</fieldsets>
<objects>
<object name="asp net user logins">
<fields>
<fieldset ref="asp net user logins" key="supplied" required="true"/>
</fields>
<operations>
<operation name="read" type="read">
<input>
<param name="login provider" type="string128" required="true"/>
<param name="provider key" type="string128" required="true"/>
<param name="user id" type="asp net users" required="true"/>
<config>
<xfk:add-to-object class="AspNetUserLoginsObject"/>
</config>
</input>
<output>
<config>
<xfk:add-to-object class="AspNetUserLoginsObject"/>
</config>
</output>
<config>
<rest:method verb="GET"
uri-template="asp-net-user-logins/{login provider}/{provider key}/{user id}"/>
</config>
<doc>
<summary>Reads the values of a Asp Net User Logins object by its key.</summary>
</doc>
</operation>
<operation name="create" type="create">
<input>
<param name="login provider" type="string128" required="true"/>
<param name="provider key" type="string128" required="true"/>
<param name="user id" type="asp net users" required="true"/>
<struct name="data">
<config>
<xfk:add-to-object class="AspNetUserLoginsObject"/>
</config>
</struct>
<config>
<xfk:add-to-object class="AspNetUserLoginsObject"/>
</config>
</input>
<config>
<rest:method verb="POST"
uri-template="asp-net-user-logins/{login provider}/{provider key}/{user id}"/>
</config>
<doc>
<summary>Creates a new Asp Net User Logins object using the specified data.</summary>
</doc>
</operation>
<operation name="update" type="update">
<input>
<param name="login provider" type="string128" required="true"/>
<param name="provider key" type="string128" required="true"/>
<param name="user id" type="asp net users" required="true"/>
<struct name="data">
<config>
<xfk:add-to-object class="AspNetUserLoginsObject"/>
</config>
</struct>
<config>
<xfk:add-to-object class="AspNetUserLoginsObject"/>
</config>
</input>
<config>
<rest:method verb="PUT"
uri-template="asp-net-user-logins/{login provider}/{provider key}/{user id}"/>
</config>
<doc>
<summary>Updates existing or creates a new Asp Net User Logins object using the specified data.</summary>
</doc>
</operation>
<operation name="delete" type="delete">
<input>
<param name="login provider" type="string128" required="true"/>
<param name="provider key" type="string128" required="true"/>
<param name="user id" type="asp net users" required="true"/>
<config>
<xfk:add-to-object class="AspNetUserLoginsObject"/>
</config>
</input>
<config>
<rest:method verb="DELETE"
uri-template="asp-net-user-logins/{login provider}/{provider key}/{user id}"/>
</config>
<doc>
<summary>Deletes the specified Asp Net User Logins object.</summary>
</doc>
</operation>
<operation name="read list" type="readlist">
<input>
<struct name="criteria">
<config>
<xfk:add-to-object class="AspNetUserLoginsCriteria"/>
</config>
</struct>
</input>
<output list="true">
<param name="login provider" type="string128" required="true"/>
<param name="provider key" type="string128" required="true"/>
<param name="user id" type="asp net users" required="true"/>
<config>
<xfk:add-to-object class="AspNetUserLoginsList"/>
</config>
</output>
<config>
<rest:method verb="GET" uri-template="asp-net-user-logins?{criteria}"/>
</config>
<doc>
<summary>Reads a list of Asp Net User Logins objects based on the specified criteria.</summary>
</doc>
</operation>
<doc>
<summary>A service for quering and managing Asp Net User Logins objects.</summary>
</doc>
</operations>
<config>
<sql:table name="AspNetUserLogins"/>
</config>
</object>
</objects>

<xfk:data-objects>
<xfk:data-object class="AspNetUserLoginsObject"/>
<xfk:data-object class="AspNetUserLoginsCriteria"/>
<xfk:data-object class="AspNetUserLoginsList" list="true">
<ui:link name="details" view="AspNetUserLoginsView" child="true">
<ui:params>
<ui:param name="login provider" field="login provider"/>
<ui:param name="provider key" field="provider key"/>
<ui:param name="user id" field="user id"/>
</ui:params>
<ui:display on-field="login provider"/>
</ui:link>
<ui:link name="new" view="AspNetUserLoginsView" child="true">
<ui:params>
<ui:param name="_action" value="create"/>
</ui:params>
</ui:link>
</xfk:data-object>
</xfk:data-objects>
<ui:views>
<ui:view name="AspNetUserLoginsView" title="Asp Net User Logins">
<ui:view-model data-object="AspNetUserLoginsObject"/>
</ui:view>
<ui:view name="AspNetUserLoginsListView" title="Asp Net User Logins List">
<ui:view-model data-object="AspNetUserLoginsList"/>
</ui:view>
</ui:views>
</module>

There is a red sqiggly under the "<output>" tag.

Could you give me some help to fix these issues?

Thanks,

GoT
xomega
#2 Posted : Monday, June 25, 2018 5:50:52 PM(UTC)
xomega



Thanks for sharing these errors. They seem to be caused by the CRUD generator not handling very well the peculiar structure of your domain object "asp net user logins", where the object consists entirely of the primary key fields, with no non-key fields.

So, for example, the standard Read operation takes by default the primary key fields, and returns other non-key fields (since you already have the keys, so no need to return those). In your case, the object has no non-key fields, so the output structure becomes empty, which is not valid in the Xomega model. Hence the error informing you that structures should either have nested <param> or <struct> elements, or reference another structure that is defined in the model (e.g. <output struct="my output structure"/>).

In your case, the entire Read operation seems to be quite odd, since you need to have the values of all the object's fields prior to calling it, as they are all part of the primary key. So there are no other fields to return there. The only point of the Read operation would then be to check if the specified user exists, i.e. throw an error if the provided user values are not in the DB.

That being said, I would advise to just delete any extraneous empty structures that were added by the CRUD generator, or to add the necessary parameters to them, if they are not supposed to be empty.

On our end though, we'll see if we can improve the CRUD generator to handle such objects better (by not adding those empty structures in the first place).

Please let me know if this makes sense to you, or if you have any other questions.
xomega
#3 Posted : Friday, August 10, 2018 8:42:31 AM(UTC)
xomega



We have fixed the issue with the CRUD generators producing elements with validation errors for objects that have only key fields. The fix is available in the new versions 7.7.4 and 6.7.4 for VS2017 and VS2015 respectively. Now the CRUD generators don't generate "read" and "update" operations for such objects, as well as no criteria for the "read list" operation.

Please download the updated version, and let us know if it works for you.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.