Git Product home page Git Product logo

Comments (2)

damiankennedy2012 avatar damiankennedy2012 commented on May 26, 2024 1

Cheers for accepting that.

Yeah, nah, I wasn't sure about the default change either. What I did was add to GetTransactions endpoint in Cdr.Banking.xml like this:

<Operation Name="GetTransactions" Text="Get transaction for account" OperationType="GetColl" WebApiRoute="{accountId}/transactions" PagingArgs="true" DataCosmosPartitionKey="accountId">
    <!-- Note usage of ValidatorFluent which will inject the code as-is into the validation logic; being a common validator 'Validators.Account' that will perform the authorization check. -->
    <Parameter Name="AccountId" Type="string" ValidatorFluent="Common(Validators.AccountId)" WebApiFrom="FromRoute" IsMandatory="true" />
    <Parameter Name="Args" Type="TransactionArgs" Validator="TransactionArgsValidator" />
    <Parameter Name="SomethingName" Type="List&lt;string&gt;" />
  </Operation>

So it might be because I added it as the last parameter that on regen the extra controller method parameter without a default was added after the existing default controller parameters which then caused a syntax error. Will use Default="default" 👍

from beef.

chullybun avatar chullybun commented on May 26, 2024

Pull request accepted; many thanks 👍

However, with the exception of the Web API Controller parameter default. This fix created other issues with the likes of Create and Update where the value was defaulting to = default where the value was not nullable. If a parameter should be defaulted for a controller then the parameter default code-gen configuration should be used; for example: <Parameter Name="Names" Type="List&lt;string&gt;" Default="default" />.

@damiankennedy2012, if you are having an issue with the defaulting are you able to provide further context/example so I can replicate?

Published Beef.CodeGen.Core NuGet package version 4.1.6.

from beef.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.