wzr1337 / rsi.server

This project implements the Volkswagen Infotainment Web Interface as published under https://www.w3.org/Submission/2016/01/. The viwi is now called RESTful service interface (rsi)
MIT License
62 stars 18 forks source link

Report an error when pushing elements with already existing id to a resource. #77

Open wzr1337 opened 6 years ago

wzr1337 commented 6 years ago

The following code snippet should fail

while(1) {
            let anim = new BehaviorSubject<AnimalElement>({
                lastUpdate: Date.now(),
                propertiesChanged: ["animalname", "genus", "genus"],
                data: {
                    uri: "/" + this.service.name.toLowerCase() + "/" + this.name.toLowerCase() + "/" + AnimalData.animalDataId,
                    id: AnimalData.animalDataId,
                    name: "OBD",
                    animalname: JSON.parse(data).animalName,
                    genus: JSON.parse(data).genus,
                    species: JSON.parse(data).species
                }
            });
            this.animalRenderer.push(anim);
        }