Giter Club home page Giter Club logo

Comments (4)

raphael avatar raphael commented on June 9, 2024

Hello, externalDocs is supported via the Docs DSL. There is no support today for deprecated, would be a great contribution though!

from goa.

xlanor avatar xlanor commented on June 9, 2024

@raphael - happy to contribute. which DSL would you reccomend I look under to begin working on deprecated?

from goa.

raphael avatar raphael commented on June 9, 2024

Awesome! Probably the most straightforward way of adding Deprecated would be to introduce it as a new DSL function that simply adds a metadata to the method. The OpenAPI code generator would then look at whether this metadata is defined on a method and if so set the Deprecated field on the operation object. This would have to be done in both the v2 and v3 generators.

  • Example that adds a meta entry. In this case the new Deprecated function would get the current scope using eval.Current() and make sure it's a HTTPEndpointExpr, similar to how the route function does it. It would then add the meta entry to the HTTPEndpointExpr object.
  • Here is where we may want to check for the metadata for v3. The check can use the Last method of the MetaExpr type simillar to how mustGenerate works
  • Here is where the Deprecated field would have to be computed/set for v2.
  • The new Deprecated() DSL function that adds the Meta to a method could be added here.

Thank you for taking this on!

from goa.

xlanor avatar xlanor commented on June 9, 2024

@raphael - I have a PR ready, just need to run some tests (and write some).

Could you point me at any testing docs for new contribs? I'm getting failed tests even on v3 branch and trying to figure out if I'm missing something other than go test

from goa.

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.