Comments (4)
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.
@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.
@solarkennedy sorry, my company's doc generation standardized on Swagger so all of my RAML work got put on pause.
from pyraml-parser.
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)
- Global mediaType ignored in parsing of body HOT 1
- Order not conserved HOT 3
- parser does not include body in put request HOT 3
- submit 0.1.1 to pypi HOT 2
- Docs HOT 1
- RAML parser failed with attribute error HOT 1
- Validation shall fail on double entries (e.g. double `title`)
- TypeError: 'RamlRoot' object is not callable HOT 3
- Grabbing raml over network fails in both python 2 & 3
- mediaType support
- Defining JSON body using native RAML? HOT 3
- side-effect on other modules using PyYAML HOT 2
- Support RAML 1.0 HOT 1
- Update to latest https://pypi.org/project/PyYAML HOT 2
- ValidationError using !include for response example HOT 2
- Query parameters in HTTP methods HOT 3
- uriParameters support HOT 3
- PyPI release HOT 1
- Numeric API versions crashing parser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyraml-parser.