Giter Site home page Giter Site logo

Comments (4)

an2deg avatar an2deg commented on August 24, 2024

Hi Chris.

We can't easy extend BaseModel from YAMLObject. In this case I got TypeError:
metaclass conflict: the metaclass of a derived class must be a (non-strict)
subclass of the metaclasses of all its bases. This is because YAMLObject is
also metaclass by itself. Extending Schema from yaml.YAMLObject fixed that
but broke many tests.
If you'll find working solution I would be very grateful.

Best regards,

On Tue, Jul 14, 2015 at 9:02 AM, Chris Petersen [email protected]
wrote:

I tried to use this today to flatten out some RAML files (so I could
import them into postman) and discovered that the pyraml models don't
re-encode cleanly. Using a simple script like this one:

import pyraml.parserimport yaml
p = pyraml.parser.load('main.raml')print yaml.dump(p)

... elements encode using a variety of non-generic types like:

  • !!python/object:pyraml.entities.RamlTrait
  • !!python/object:pyraml.entities.RamlResource
  • !!python/object:pyraml.entities.RamlMethod
  • !!python/unicode (for embedded JSON schemas)

And so forth.

I haven't yet tested this but it looks like fixing some of these might be
as easy as extending BaseModel from yaml.YAMLObject instead of plain
object.

Is this something you'd be open to having fixed (even if it means creating
a pyraml.parser.dump(p) type method)? If so, I can keep poking at it.


Reply to this email directly or view it on GitHub
#22.

Andrew Degtyarev
DA-RIPE

from pyraml-parser.

solarkennedy avatar solarkennedy commented on August 24, 2024

@ex-nerd I'm also trying to flatten some RAML files like you and I found this issue. It has been a while, do you have any update on if you were able to achieve this, using this parser or anything else?

from pyraml-parser.

ex-nerd avatar ex-nerd commented on August 24, 2024

@solarkennedy sorry, my company's doc generation standardized on Swagger so all of my RAML work got put on pause.

from pyraml-parser.

solarkennedy avatar solarkennedy commented on August 24, 2024

Gotcha. This could be considered closed if the scope of this project is not intended to include raml dumping, only raml parsing.

For my particular needs I ended up using a node based API spec converter to go "from" RAML "to" RAML which created a consolidated file for me.

from pyraml-parser.

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.