Code Monkey home page Code Monkey logo

Comments (4)

goetas avatar goetas commented on September 22, 2024

hmm, that is nice
what you can do is to implement a custom naming strategy and find a way to shorten the name

from xsd2php.

time85 avatar time85 commented on September 22, 2024

thanks for the help :)

I've managed to create a naming strategy, mentioned in this PR:
#49 (comment)

from xsd2php.

time85 avatar time85 commented on September 22, 2024

to clarify, i had to take another path. the CustomNamingStrategy made problems when trying to (de)serialize, i wasn't able to create the php-object or a schema-valid xml file.

i had to change the generation part:
Created my own JMSWriter to create (sub)folders like in the generation of the php-files and add him to the config.yml

i had to change the (de)serializaion part -> jms-serializer:
created my own FileLocator and set him through:

 $serializerBuilder->setMetadataDriverFactory(new CallbackDriverFactory(function ($metadataDirs, Reader $reader) {
            return new DriverChain([
                new YamlDriver(new MyOwnFileLocator($metadataDirs), new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy())),
                new AnnotationDriver($reader, new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy())),
            ]);
        }));

atm it looks like all tests are green :)

from xsd2php.

goetas avatar goetas commented on September 22, 2024

nice idea...

having such MyOwnFileLocator in the jms/serializer would be nice

from xsd2php.

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.