Comments (1)
Closing this issue since it works as expected. I.e. Group
is translated properly
test.raml:
#%RAML 1.0
title: A CRUD API for Users and Groups
mediaType: application/json
types:
###############
# Common:
###############
Email:
pattern: "^\\w+(\\.\\w+)[email protected]"
StaticGroupNums:
description: Predefined user groups
enum: [ 12, 26, 30, 31, 32 ]
DynamicGroupNum:
description: Dynamically-defined user groups
pattern: "D\\-\\d+"
RecordId:
usage: An id of any record in the system
type: number
Record-base:
usage: Pattern for any record in the system
properties:
id:
type: RecordId
required: true
created:
type: datetime
required: true
###############
# User:
###############
User-base:
usage: The base type for user records
properties:
firstname:
required: true
lastname:
required: true
User-new:
usage: Data for creating a new user
type: User-base
properties:
HRAuth:
description: Authorization received from HR
required: true
User-update:
usage: Changeable properties of an existing user
properties:
firstname:
lastname:
User:
usage: A user in the system
type: [ User-base, Record-base ]
properties:
emails: Email[]
###############
# Group:
###############
Group-base:
usage: The base type for group records
properties:
name:
required: true
Group-new:
usage: Data for creating a new group
type: Group-base
properties:
ITAuth:
description: Authorization received from IT
required: true
Group-update:
usage: Changeable properties of an existing group
properties:
name:
Group:
usage: A group in the system
type: [ Group-base, Record-base ]
properties:
groupnum:
type: StaticGroupNums | DynamicGroupNum
required: true
$ dt2js ./test.raml Group
{
"usage": "A group in the system",
"properties": {
"id": {
"usage": "An id of any record in the system",
"type": "number"
},
"created": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2})(:)(\\d{2})(:)(\\d{2})(\\.\\d+)?(Z|([+-])(\\d{2})(:)?(\\d{2}))$"
},
"name": {
"type": "any"
},
"groupnum": {
"type": "object",
"anyOf": [
{
"description": "Predefined user groups",
"enum": [
12,
26,
30,
31,
32
],
"type": "any"
},
{
"description": "Dynamically-defined user groups",
"pattern": "D\\-\\d+",
"type": "any"
}
]
}
},
"type": "object",
"additionalProperties": true,
"required": [
"id",
"created",
"name",
"groupnum"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}
from ramldt2jsonschema.
Related Issues (20)
- An in-range update of commander is breaking the build 🚨 HOT 1
- Use webapi-parser to convert HOT 3
- Compare old vs new conversion output HOT 4
- Schema generation not working properly when raml key contains dot('.') in it HOT 3
- Test & describe accurately the limitations in the README HOT 1
- Fails silently for (some) old node versions - include min version in ReadMe? HOT 1
- RAML to JSON schema conversion not working properly HOT 7
- Add type:nil support HOT 2
- `dt2js` does not always output a `$schema` property HOT 4
- Validate RAML Datatype output of js2dt
- JSON schema to RAML not converting arrays HOT 5
- Question js2dt HOT 7
- Is a 'full API definition json' to raml conversion possible? HOT 12
- "Cannot parse document with specified vendor: OAS 2.0" despite attempting to run js2dt command HOT 4
- resolving references not working HOT 4
- script not working on windows; need help HOT 1
- Can someone review the bot pull request please?
- All versions greater than v1.0.0 have CLI dt2js broken! HOT 3
- Please update README for Mandatory dependency to ajv
- Dependency to json-schema-migrate
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 ramldt2jsonschema.