jhipster / jdl-studio

JDL Studio is an online JHipster Domain Language visual editor
https://start.jhipster.tech/jdl-studio/
Apache License 2.0
405 stars 114 forks source link

Ambigious syntax errors #54

Closed congruentsquare closed 6 years ago

congruentsquare commented 6 years ago

I am getting this error when I try to import my jdl into my project:

$ jhipster import-jdl ./Assets/jhipster-jdl.jh --serverOnly
Using JHipster version installed globally
Executing jhipster:import-jdl ./Assets/jhipster-jdl.jh
Options: serverOnly: true, server-only: true
The JDL is being parsed.
Error: Valid source and destination entities are required.
ERROR! ERROR! Error while parsing applications and entities from the JDL Error: Valid source and destination entities are required.
Error: ERROR! Error while parsing applications and entities from the JDL Error: Valid source and destination entities are required.
    at Environment.error (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:157:40)
    at module.exports.error (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base.js:1978:18)
    at module.exports.importJDL (/usr/local/lib/node_modules/generator-jhipster/generators/import-jdl/index.js:115:14)
    at new ImporterGenerator (/usr/local/lib/node_modules/generator-jhipster/generators/import-jdl/index.js:80:38)
    at new module.exports (/usr/local/lib/node_modules/generator-jhipster/generators/import-jdl/index.js:122:9)
    at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:408:12)
    at Environment.create (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:386:17)
    at Environment.run (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:443:28)
    at runYoCommand (/usr/local/lib/node_modules/generator-jhipster/cli/cli.js:63:13)
    at Command.command.allowUnknownOption.description.action (/usr/local/lib/node_modules/generator-jhipster/cli/cli.js:83:13)

I believe this a syntax error but it doesn't point to a line number and from eye-balling my file there doesn't seem to be any syntax issues. Here's my jdl:

entity Address {
    StreetNumber Integer,
    HouseName String,
    StreetNumberSuffix String,
    StreetName String,
    StreetType String,
    StreetDirection String,
    AddressType String,
    AddressTypeIdentifier String,
    LocalMunicipality String,
    CityTown String,
    GoverningDistrict String,
    PostalArea String,
    Country String,
    Latitude String,
    Longitude String
}

entity HomeInfo {
    HomestayName String,
    HomestayShortDescription String,
    HomestayDescription String
}

entity Room {
    RoomName String,
    SquareFootage Float,
    HasRefrigirator Boolean,
    PrivateBathroom Boolean
}

entity Pricing {
    Price BigDecimal,
    BeginDate ZonedDateTime,
    EndDate ZonedDateTime
}

entity RoomImage {
    Name String,
    Alt String,
    File ImageBlob,
    UploadDate ZonedDateTime,
    FileUrl String,
}

entity HouseImage {
    Name String,
    Alt String,
    File ImageBlob,
    UploadDate ZonedDateTime,
    FileUrl String,
}

entity PersonImage {
    Name String,
    Alt String,
    File ImageBlob,
    UploadDate ZonedDateTime,
    FileUrl String
}

entity Payment {
    TimeStamp Instant,
    Method String,
}

entity Person {
    FirstName String,
    Surname String,
    PreferredLanguage String,
    Age Integer
}

entity Reservation {
    StartDate ZonedDateTime,
    EndDate ZonedDateTime,
    TimeStamp ZonedDateTime
}

entity Host {
    MembershipType String,
    SignUpDate ZonedDateTime,
    ResignationDate ZonedDateTime
}

entity Student {
    LookingToStudy String,
    School String,
    PriceMin BigDecimal,
    PriceMax BigDecimal,
    StudyingInCity String,
    SignUpDate ZonedDateTime,
    ResignationDate ZonedDateTime
    Interests String
}

entity Activity {
    TimeStamp ZonedDateTime,
    ActionType String
}

entity Pet {
    Name String,
    Species String,
    Hypoallergenic Boolean
}

relationship OneToOne {
    Host to Person,
    Student to Person,
    Address to Person,
    Reservation to Host,
    Reservation to Student,
    Reservation to Address,
    HomeInfo to Address,
    Payment to Reservation
}

relationship OneToMany {
    HomeInfo to Room,
    Room to RoomImage,
    Person to PersonImage,
    HomeInfo to HomeImage,
    HomeInfo to Pet,
    Room to Pricing,
    Host to Reservation,
    Student to Reservation,
    Person to Activity,
    Person to PersonImage,
    Room to RoomImage,
    Address to HouseImage
}

Any ideas?

EDIT --- Found the error on my relationships:

relationship OneToOne {
    Host to Person,
    Student to Person,
    Address to Person,
    HomeInfo to Address,
    Payment to Reservation
}

relationship OneToMany {
    HomestayInfo to Room,
    Room to RoomImage,
    Person to PersonImage,
    HomeInfo to HouseImage,
    HomeInfo to Pet,
    Room to Pricing,
    Host to Reservation,
    Student to Reservation,
    Person to Activity,
    Address to HouseImage
}
deepu105 commented 6 years ago

This is not the correct repo for this. Please open an issue in https://github.com/jhipster/generator-jhipster/issues